MCPcopy Create free account
hub / github.com/google/pprof / panMove

Function panMove

internal/driver/html/common.js:90–109  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

88 }
89
90 function panMove(x, y) {
91 let dx = x - panLastX;
92 let dy = y - panLastY;
93 if (Math.abs(dx) <= 2 && Math.abs(dy) <= 2) return; // Ignore tiny moves
94
95 moved = true;
96 panLastX = x;
97 panLastY = y;
98
99 // Firefox workaround: get dimensions from parentNode.
100 const swidth = svg.clientWidth || svg.parentNode.clientWidth;
101 const sheight = svg.clientHeight || svg.parentNode.clientHeight;
102
103 // Convert deltas from screen space to svg space.
104 dx *= (svg.viewBox.baseVal.width / swidth);
105 dy *= (svg.viewBox.baseVal.height / sheight);
106
107 svg.viewBox.baseVal.x -= dx;
108 svg.viewBox.baseVal.y -= dy;
109 }
110
111 function handleScanStart(e) {
112 if (e.button != 0) return; // Do not catch right-clicks etc.

Callers 4

handleScanMoveFunction · 0.85
handleScanEndFunction · 0.85
handleTouchMoveFunction · 0.85
handleTouchEndFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…