defaultHitTestChildren should return whether it hit something
Some clients want to know whether they hit their children.
This commit is contained in:
parent
11ee06dd50
commit
5ea4763025
@ -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
|
|||||||
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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user