Commit 325bfcc7 authored by Adam Barth's avatar Adam Barth

Fix RenderViewport's hit testing

We were subtracting the scrollOffset when we were supposed to add it.
parent 78e18a5d
...@@ -1240,11 +1240,11 @@ class RenderViewport extends RenderBox with RenderObjectWithChildMixin<RenderBox ...@@ -1240,11 +1240,11 @@ class RenderViewport extends RenderBox with RenderObjectWithChildMixin<RenderBox
if (child != null) { if (child != null) {
assert(child.parentData is BoxParentData); assert(child.parentData is BoxParentData);
Rect childBounds = child.parentData.position & child.size; Rect childBounds = child.parentData.position & child.size;
if (childBounds.contains(position + -scrollOffset)) Point transformedPosition = position + scrollOffset;
child.hitTest(result, position: position + scrollOffset); if (childBounds.contains(transformedPosition))
child.hitTest(result, position: transformedPosition);
} }
} }
} }
class RenderImage extends RenderBox { class RenderImage extends RenderBox {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment