diff --git a/src/components/map/MapGridEditor.js b/src/components/map/MapGridEditor.js index 8962654..a059180 100644 --- a/src/components/map/MapGridEditor.js +++ b/src/components/map/MapGridEditor.js @@ -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; diff --git a/src/helpers/grid.js b/src/helpers/grid.js index 9620012..b7612c8 100644 --- a/src/helpers/grid.js +++ b/src/helpers/grid.js @@ -212,7 +212,10 @@ export function getGridDefaultInset(grid, mapWidth, mapHeight) { * @returns {GridInset} */ export function getGridUpdatedInset(grid, mapWidth, mapHeight) { - let inset = grid.inset; + let inset = { + topLeft: { ...grid.inset.topLeft }, + bottomRight: { ...grid.inset.bottomRight }, + }; // Take current inset width and use it to calculate the new height if (grid.size.x > 0 && grid.size.x > 0) { // Convert to px relative to map size