Commit 8bb1bb9e authored by Adam Barth's avatar Adam Barth

Merge pull request #451 from abarth/fix_hit_testing

Fix RenderViewport's hit testing
parents bce16609 325bfcc7
...@@ -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