Spaces:
Runtime error
Runtime error
no round for cursor movement
Browse files
frontend/src/lib/PaintCanvas.svelte
CHANGED
@@ -114,8 +114,8 @@
|
|
114 |
// Update cursor presence to current pointer location
|
115 |
function handlePointerMove(event: PointerEvent) {
|
116 |
event.preventDefault();
|
117 |
-
const x =
|
118 |
-
const y =
|
119 |
|
120 |
myPresence.update({
|
121 |
cursor: {
|
|
|
114 |
// Update cursor presence to current pointer location
|
115 |
function handlePointerMove(event: PointerEvent) {
|
116 |
event.preventDefault();
|
117 |
+
const x = $currZoomTransform.invertX(event.clientX);
|
118 |
+
const y = $currZoomTransform.invertY(event.clientY);
|
119 |
|
120 |
myPresence.update({
|
121 |
cursor: {
|
frontend/src/lib/PaintFrame.svelte
CHANGED
@@ -39,8 +39,8 @@
|
|
39 |
};
|
40 |
myPresence.update({
|
41 |
cursor: {
|
42 |
-
x: x
|
43 |
-
y: y
|
44 |
}
|
45 |
});
|
46 |
}
|
@@ -59,14 +59,10 @@
|
|
59 |
});
|
60 |
}
|
61 |
function handlePointerMove(event: PointerEvent) {
|
62 |
-
event.preventDefault();
|
63 |
-
const x = round(transform.invertX(event.clientX));
|
64 |
-
const y = round(transform.invertY(event.clientY));
|
65 |
-
|
66 |
myPresence.update({
|
67 |
cursor: {
|
68 |
-
x,
|
69 |
-
y
|
70 |
}
|
71 |
});
|
72 |
}
|
|
|
39 |
};
|
40 |
myPresence.update({
|
41 |
cursor: {
|
42 |
+
x: transform.invertX(event.x),
|
43 |
+
y: transform.invertY(event.y)
|
44 |
}
|
45 |
});
|
46 |
}
|
|
|
59 |
});
|
60 |
}
|
61 |
function handlePointerMove(event: PointerEvent) {
|
|
|
|
|
|
|
|
|
62 |
myPresence.update({
|
63 |
cursor: {
|
64 |
+
x: transform.invertX(event.clientX),
|
65 |
+
y: transform.invertY(event.clientY)
|
66 |
}
|
67 |
});
|
68 |
}
|