Skip to content

Commit

Permalink
Add conversion from grid distance to point location
Browse files Browse the repository at this point in the history
  • Loading branch information
caewok committed Jul 25, 2021
1 parent 3e3cd01 commit 66b452e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function gridDistance(A, B) {

if(use_grid) {
const distance_segments = [{ray: new Ray(A, B)}];
return canvas.grid.measureDistances(distance_segments, { gridSpaces: true })[0];
return canvas.grid.measureDistances(distance_segments, { gridSpaces: true })[0] * canvas.scene.data.grid / canvas.scene.data.gridDistance;
}

return window.libRuler.RulerUtilities.calculateDistance({x: A.x, y: A.y},
Expand Down

0 comments on commit 66b452e

Please sign in to comment.