Skip to content

Commit

Permalink
Properly recognize a large hex token's shape
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelVo committed Oct 15, 2022
1 parent 5a62c8f commit 5acf0f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export function isModuleActive(moduleName) {

// A copy of this function lives in the drag ruler module
export function getHexTokenSize(token) {
const size = token.width;
if (token.height !== size) {
const size = token.document.width;
if (token.document.height !== size) {
return 1;
}
return size;
Expand Down Expand Up @@ -146,9 +146,9 @@ export function getAreaFromPositionAndShape(position, shape) {
let y = position.y + space.y;
if (canvas.grid.isHex) {
let shiftedRow;
if (canvas.grid.grid.options.even) shiftedRow = 1;
if (canvas.grid.grid.even) shiftedRow = 1;
else shiftedRow = 0;
if (canvas.grid.grid.options.columns) {
if (canvas.grid.grid.columnar) {
if (space.x % 2 !== 0 && position.x % 2 !== shiftedRow) {
y += 1;
}
Expand Down

0 comments on commit 5acf0f6

Please sign in to comment.