MCPcopy
hub / github.com/Lightricks/ComfyUI-LTXVideo / hitTestPoint

Function hitTestPoint

web/js/sparse_track_editor.js:318–331  ·  view source on GitHub ↗
(node, canvasPos)

Source from the content-addressed store, hash-verified

316// ---------------------------------------------------------------------------
317
318function hitTestPoint(node, canvasPos) {
319 const ed = node._ed;
320 const dpr = window.devicePixelRatio || 1;
321 const tol = HIT_TOLERANCE * dpr;
322 for (let si = 0; si < ed.splines.length; si++) {
323 for (let pi = 0; pi < ed.splines[si].length; pi++) {
324 const cp = imgToCanvas(node, ed.splines[si][pi]);
325 if (dist(cp, canvasPos) < tol) {
326 return { si, pi };
327 }
328 }
329 }
330 return null;
331}
332
333// ---------------------------------------------------------------------------
334// Context menu

Callers 2

showMenuFunction · 0.85
setupEventsFunction · 0.85

Calls 2

imgToCanvasFunction · 0.85
distFunction · 0.85

Tested by

no test coverage detected