MCPcopy Create free account
hub / github.com/chartjs/Chart.js / inRange

Method inRange

src/elements/element.point.ts:62–66  ·  view source on GitHub ↗
(mouseX: number, mouseY: number, useFinalPosition?: boolean)

Source from the content-addressed store, hash-verified

60 }
61
62 inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean) {
63 const options = this.options;
64 const {x, y} = this.getProps(['x', 'y'], useFinalPosition);
65 return ((Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2)) < Math.pow(options.hitRadius + options.radius, 2));
66 }
67
68 inXRange(mouseX: number, useFinalPosition?: boolean) {
69 return inRange(this, mouseX, 'x', useFinalPosition);

Callers

nothing calls this directly

Calls 1

getPropsMethod · 0.80

Tested by

no test coverage detected