Fix logic error in markNeedsPaint (#112735)

* Update object.dart

* Update object.dart

* Update object.dart

* Update object.dart

* Update object.dart
This commit is contained in:
fzyzcjy 2022-11-16 08:06:51 +08:00 committed by GitHub
parent 349d6486e9
commit 7d2b01132d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2627,10 +2627,13 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
}
return true;
}());
// If we're the root of the render tree (probably a RenderView),
// then we have to paint ourselves, since nobody else can paint
// us. We don't add ourselves to _nodesNeedingPaint in this
// case, because the root is always told to paint regardless.
// If we are the root of the render tree and not a repaint boundary
// then we have to paint ourselves, since nobody else can paint us.
// We don't add ourselves to _nodesNeedingPaint in this case,
// because the root is always told to paint regardless.
//
// Trees rooted at a RenderView do not go through this
// code path because RenderViews are repaint boundaries.
if (owner != null) {
owner!.requestVisualUpdate();
}