Fix RenderViewport's hit testing

We were subtracting the scrollOffset when we were supposed to add it.
This commit is contained in:
Adam Barth
2015-08-04 15:54:51 -07:00
parent 78e18a5d18
commit 325bfcc739

View File

@@ -1240,11 +1240,11 @@ class RenderViewport extends RenderBox with RenderObjectWithChildMixin<RenderBox
if (child != null) {
assert(child.parentData is BoxParentData);
Rect childBounds = child.parentData.position & child.size;
if (childBounds.contains(position + -scrollOffset))
child.hitTest(result, position: position + scrollOffset);
Point transformedPosition = position + scrollOffset;
if (childBounds.contains(transformedPosition))
child.hitTest(result, position: transformedPosition);
}
}
}
class RenderImage extends RenderBox {