Fix selection menu position with offset

This commit is contained in:
Mitchell McCaffrey 2021-07-22 16:00:04 +10:00
parent 4ac4c3aa33
commit 60760e3d8e

View File

@ -56,7 +56,10 @@ function SelectionMenu({
const points = getSelectionPoints(selection);
const bounds = Vector2.getBoundingBox(points);
let menuPosition = new Vector2(bounds.center.x, bounds.max.y);
let menuPosition = new Vector2(
bounds.center.x + selection.x,
bounds.max.y + selection.y
);
const mapImage = mapStage.findOne("#mapImage");
if (!mapImage) {
return;