MCPcopy
hub / github.com/chartjs/Chart.js / _isPointInArea

Function _isPointInArea

src/helpers/helpers.canvas.ts:317–326  ·  view source on GitHub ↗
(
  point: Point,
  area: TRBL,
  margin?: number
)

Source from the content-addressed store, hash-verified

315 * @private
316 */
317export function _isPointInArea(
318 point: Point,
319 area: TRBL,
320 margin?: number
321) {
322 margin = margin || 0.5; // margin - default is to match rounded decimals
323
324 return !area || (point && point.x > area.left - margin && point.x < area.right + margin &&
325 point.y > area.top - margin && point.y < area.bottom + margin);
326}
327
328export function clipArea(ctx: CanvasRenderingContext2D, area: TRBL) {
329 ctx.save();

Callers 5

evaluationFuncFunction · 0.85
isPointInAreaMethod · 0.85
capBezierPointsFunction · 0.85
isNotOverlappedFunction · 0.85
drawMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected