@@ -1166,6 +1166,14 @@ function getShapeResizeHandleAt(mx, my) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onMouseDown(e) {
|
function onMouseDown(e) {
|
||||||
|
if (e.button === 2) {
|
||||||
|
isPanning = true;
|
||||||
|
panStartX = e.clientX;
|
||||||
|
panStartY = e.clientY;
|
||||||
|
canvas.style.cursor = 'grabbing';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (e.button !== 0) return;
|
||||||
const rect = canvas.getBoundingClientRect();
|
const rect = canvas.getBoundingClientRect();
|
||||||
const mx = e.clientX - rect.left - panX;
|
const mx = e.clientX - rect.left - panX;
|
||||||
const my = e.clientY - rect.top - panY;
|
const my = e.clientY - rect.top - panY;
|
||||||
|
|||||||
Reference in New Issue
Block a user