Fix grid size change when grid is offset
This commit is contained in:
parent
1043f093cd
commit
076213fa25
@ -44,7 +44,7 @@ function MapSettings({
|
|||||||
if (value > 0) {
|
if (value > 0) {
|
||||||
const gridScale =
|
const gridScale =
|
||||||
((inset.bottomRight.x - inset.topLeft.x) * map.width) / value;
|
((inset.bottomRight.x - inset.topLeft.x) * map.width) / value;
|
||||||
inset.bottomRight.y = (gridY * gridScale) / map.height;
|
inset.bottomRight.y = inset.topLeft.y + (gridY * gridScale) / map.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
onSettingsChange("grid", {
|
onSettingsChange("grid", {
|
||||||
@ -66,7 +66,7 @@ function MapSettings({
|
|||||||
if (gridX > 0) {
|
if (gridX > 0) {
|
||||||
const gridScale =
|
const gridScale =
|
||||||
((inset.bottomRight.x - inset.topLeft.x) * map.width) / gridX;
|
((inset.bottomRight.x - inset.topLeft.x) * map.width) / gridX;
|
||||||
inset.bottomRight.y = (value * gridScale) / map.height;
|
inset.bottomRight.y = inset.topLeft.y + (value * gridScale) / map.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
onSettingsChange("grid", {
|
onSettingsChange("grid", {
|
||||||
|
Loading…
Reference in New Issue
Block a user