(x, y)
| 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…