From 8c2f61b76475d137215055074e471c606f7b954c Mon Sep 17 00:00:00 2001 From: Alan Mantoux Date: Sun, 11 Aug 2024 11:51:52 +0200 Subject: [PATCH] Adapt position with viewport offset when hit testing children --- packages/fleather/lib/src/rendering/editor.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/fleather/lib/src/rendering/editor.dart b/packages/fleather/lib/src/rendering/editor.dart index 3fc17cb7..ce069de5 100644 --- a/packages/fleather/lib/src/rendering/editor.dart +++ b/packages/fleather/lib/src/rendering/editor.dart @@ -661,7 +661,8 @@ class RenderEditor extends RenderEditableContainerBox @override bool hitTestChildren(BoxHitTestResult result, {required Offset position}) { - return defaultHitTestChildren(result, position: position); + final Offset effectivePosition = position - paintOffset; + return defaultHitTestChildren(result, position: effectivePosition); } void _paintHandleLayers(