Added grid scale and offset to maps and refactored into grid object

This commit is contained in:
Mitchell McCaffrey
2020-10-02 15:19:10 +10:00
parent 54a60d6c76
commit 539f216cfe
9 changed files with 46 additions and 22 deletions

View File

@@ -21,8 +21,6 @@ import AuthContext from "../contexts/AuthContext";
const defaultMapSize = 22;
const defaultMapProps = {
// Grid type
// TODO: add support for hex horizontal and hex vertical
gridType: "grid",
showGrid: false,
snapToGrid: true,
quality: "original",
@@ -167,8 +165,12 @@ function SelectMapModal({
resolutions,
name,
type: "file",
gridX: fileGridX,
gridY: fileGridY,
grid: {
size: { x: fileGridX, y: fileGridY },
scale: { x: 1, y: 1 },
offset: { x: 0, y: 0 },
type: "square",
},
width: image.width,
height: image.height,
id: shortid.generate(),