Fix grid editor mutably changing grid state

This commit is contained in:
Mitchell McCaffrey
2021-06-12 13:14:46 +10:00
parent 833f0082ba
commit 3d74dfc88a
2 changed files with 8 additions and 2 deletions

View File

@@ -77,7 +77,10 @@ function MapGridEditor({ map, onGridChange }) {
Vector2.subtract(position, previousPosition)
);
const inset = map.grid.inset;
const inset = {
topLeft: { ...map.grid.inset.topLeft },
bottomRight: { ...map.grid.inset.bottomRight },
};
if (direction.x === 0 && direction.y === 0) {
return inset;