diff --git a/lib/components/pages/loco_timeline/timeline_grid.dart b/lib/components/pages/loco_timeline/timeline_grid.dart index c9383ff..ad919af 100644 --- a/lib/components/pages/loco_timeline/timeline_grid.dart +++ b/lib/components/pages/loco_timeline/timeline_grid.dart @@ -447,13 +447,11 @@ class _ValueBlockMenu extends StatelessWidget { final overlay = Overlay.of(context); final renderBox = overlay?.context.findRenderObject() as RenderBox?; if (renderBox == null) return; + // Translate from global screen coordinates into the overlay's local space + // so the menu appears where the gesture happened. + final localPosition = renderBox.globalToLocal(globalPosition); final position = RelativeRect.fromRect( - Rect.fromLTWH( - globalPosition.dx, - globalPosition.dy, - 1, - 1, - ), + Rect.fromLTWH(localPosition.dx, localPosition.dy, 1, 1), Offset.zero & renderBox.size, );