fix hex calculations in v12
This commit is contained in:
+3
-2
@@ -157,7 +157,8 @@ export function getAreaFromPositionAndShape(position, shape) {
|
||||
let y = position.y + space.y;
|
||||
if (isCanvasHex()) {
|
||||
let shiftedRow;
|
||||
if (canvas.grid.grid.options.even) shiftedRow = 1;
|
||||
// v12 ?? v11
|
||||
if (canvas.grid?.even ?? canvas.grid.grid.options.even) shiftedRow = 1;
|
||||
else shiftedRow = 0;
|
||||
if (canvas.grid.grid.columnar) {
|
||||
if (space.x % 2 !== 0 && position.x % 2 !== shiftedRow) {
|
||||
@@ -329,4 +330,4 @@ function isCanvasHex() {
|
||||
// isHexagonal is introduced in V12 (undefined in V11)
|
||||
// isHex is deprecated since V12
|
||||
return canvas.grid.isHexagonal ?? canvas.grid.isHex
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user