From 60760e3d8e556e6e2c50448b1b994aec5d0c908c Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Thu, 22 Jul 2021 16:00:04 +1000 Subject: [PATCH] Fix selection menu position with offset --- src/components/selection/SelectionMenu.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/selection/SelectionMenu.tsx b/src/components/selection/SelectionMenu.tsx index 445ccb0..ba1d614 100644 --- a/src/components/selection/SelectionMenu.tsx +++ b/src/components/selection/SelectionMenu.tsx @@ -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;