fix: zooming on canvas setting cursor to corner of block
This commit is contained in:
parent
8a3ccfc024
commit
f89fe702e9
1 changed files with 3 additions and 3 deletions
|
|
@ -125,11 +125,11 @@ function Canvas() {
|
|||
|
||||
setScale(newScale);
|
||||
setCoords({
|
||||
x: mousePosition.x - mouseCoords.x * 16 * newScale,
|
||||
y: mousePosition.y - mouseCoords.y * 16 * newScale,
|
||||
x: mousePosition.x - ((mousePosition.x - coords.x) / scale) * newScale,
|
||||
y: mousePosition.y - ((mousePosition.y - coords.y) / scale) * newScale,
|
||||
});
|
||||
},
|
||||
[scale, mouseCoords, mousePosition]
|
||||
[scale, coords, mousePosition]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue