MCPcopy Create free account
hub / github.com/openscopeproject/InteractiveHtmlBom / pointWithinPad

Function pointWithinPad

InteractiveHtmlBom/web/render.js:749–757  ·  view source on GitHub ↗
(x, y, pad)

Source from the content-addressed store, hash-verified

747}
748
749function pointWithinPad(x, y, pad) {
750 var v = [x - pad.pos[0], y - pad.pos[1]];
751 v = rotateVector(v, pad.angle);
752 if (pad.offset) {
753 v[0] -= pad.offset[0];
754 v[1] -= pad.offset[1];
755 }
756 return emptyContext2d.isPointInPath(getCachedPadPath(pad), ...v);
757}
758
759function netHitScan(layer, x, y) {
760 // Check track segments

Callers 1

netHitScanFunction · 0.85

Calls 2

rotateVectorFunction · 0.85
getCachedPadPathFunction · 0.85

Tested by

no test coverage detected