Commit bc169671 authored by Adam Barth's avatar Adam Barth

Merge pull request #1051 from abarth/default_hit_test_children

defaultHitTestChildren should return whether it hit something
parents ef023286 5ea47630
...@@ -519,7 +519,7 @@ abstract class RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, Pare ...@@ -519,7 +519,7 @@ abstract class RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, Pare
return result; return result;
} }
void defaultHitTestChildren(HitTestResult result, { Point position }) { bool defaultHitTestChildren(HitTestResult result, { Point position }) {
// the x, y parameters have the top left of the node's box as the origin // the x, y parameters have the top left of the node's box as the origin
ChildType child = lastChild; ChildType child = lastChild;
while (child != null) { while (child != null) {
...@@ -527,9 +527,10 @@ abstract class RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, Pare ...@@ -527,9 +527,10 @@ abstract class RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, Pare
Point transformed = new Point(position.x - child.parentData.position.x, Point transformed = new Point(position.x - child.parentData.position.x,
position.y - child.parentData.position.y); position.y - child.parentData.position.y);
if (child.hitTest(result, position: transformed)) if (child.hitTest(result, position: transformed))
break; return true;
child = child.parentData.previousSibling; child = child.parentData.previousSibling;
} }
return false;
} }
void defaultPaint(PaintingContext context, Offset offset) { void defaultPaint(PaintingContext context, Offset offset) {
......
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