MCPcopy Create free account
hub / github.com/dashrobotco/robot-components / getDisplacedPosition

Function getDisplacedPosition

app/nodegrid/page.tsx:2892–2910  ·  view source on GitHub ↗
(baseX: number, baseY: number)

Source from the content-addressed store, hash-verified

2890
2891 // Helper to calculate displaced position from ALL panels (main + floating)
2892 const getDisplacedPosition = (baseX: number, baseY: number) => {
2893 // Start with push from main panel
2894 let totalPushX = 0;
2895 let totalPushY = 0;
2896
2897 const mainPush = getPanelPush(baseX, baseY, panelLeft, panelRight, panelTop, panelBottom);
2898 totalPushX += mainPush.x;
2899 totalPushY += mainPush.y;
2900
2901 // Add push from all floating panels
2902 const floatingPanels = panelsRef.current;
2903 for (const fp of floatingPanels) {
2904 const fpPush = getPanelPush(baseX, baseY, fp.x, fp.x + fp.width, fp.y, fp.y + fp.height);
2905 totalPushX += fpPush.x;
2906 totalPushY += fpPush.y;
2907 }
2908
2909 return { x: baseX + totalPushX, y: baseY + totalPushY };
2910 };
2911
2912 // Hidden dense grid - only visible during pulses
2913 // Draw at half the spacing (double density)

Callers 1

animateFunction · 0.85

Calls 1

getPanelPushFunction · 0.85

Tested by

no test coverage detected