fix(snaptogrid): don't scale grid size closes #261
This commit is contained in:
+3
-4
@@ -195,12 +195,11 @@ const storeModel: StoreModel = {
|
|||||||
let position: XYPosition = pos;
|
let position: XYPosition = pos;
|
||||||
|
|
||||||
if (state.snapToGrid) {
|
if (state.snapToGrid) {
|
||||||
const transformedGridSizeX = state.snapGrid[0] * state.transform[2];
|
const [gridSizeX, gridSizeY] = state.snapGrid;
|
||||||
const transformedGridSizeY = state.snapGrid[1] * state.transform[2];
|
|
||||||
|
|
||||||
position = {
|
position = {
|
||||||
x: transformedGridSizeX * Math.round(pos.x / transformedGridSizeX),
|
x: gridSizeX * Math.round(pos.x / gridSizeX),
|
||||||
y: transformedGridSizeY * Math.round(pos.y / transformedGridSizeY),
|
y: gridSizeY * Math.round(pos.y / gridSizeY),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user