Add support for difficult terrain measurements on euclidean gridded scenes (resolves #134)
This commit is contained in:
@@ -16,7 +16,10 @@ export function highlightMeasurementTerrainRuler(ray, startDistance, tokenShape=
|
|||||||
|
|
||||||
export function measureDistances(segments, entity, shape, options={}) {
|
export function measureDistances(segments, entity, shape, options={}) {
|
||||||
const opts = duplicate(options)
|
const opts = duplicate(options)
|
||||||
|
if (canvas.grid.diagonalRule === "EUCL") {
|
||||||
|
opts.ignoreGrid = true;
|
||||||
|
opts.gridSpaes = false;
|
||||||
|
}
|
||||||
if (opts.enableTerrainRuler) {
|
if (opts.enableTerrainRuler) {
|
||||||
opts.gridSpaces = true;
|
opts.gridSpaces = true;
|
||||||
const firstNewSegmentIndex = segments.findIndex(segment => !segment.ray.dragRulerVisitedSpaces);
|
const firstNewSegmentIndex = segments.findIndex(segment => !segment.ray.dragRulerVisitedSpaces);
|
||||||
|
|||||||
@@ -165,6 +165,11 @@ export function measure(destination, options={}) {
|
|||||||
options.gridSpaces = canvas.grid.type !== CONST.GRID_TYPES.GRIDLESS;
|
options.gridSpaces = canvas.grid.type !== CONST.GRID_TYPES.GRIDLESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (canvas.grid.diagonalRule === "EUCL") {
|
||||||
|
options.gridSpaces = false;
|
||||||
|
options.ignoreGrid = true;
|
||||||
|
}
|
||||||
|
|
||||||
if(options.ignoreGrid === undefined) {
|
if(options.ignoreGrid === undefined) {
|
||||||
options.ignoreGrid = false;
|
options.ignoreGrid = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user