_markNeedsClip() when clipper type has changed. (#18248)

A bug in _RenderCustomClip was compaeing the type of oldClipper to
itself instead to the type of newClipper.

This was the root cause for the crash #14937 worked around.
This also reverts the workaround introduced in #14937.
This commit is contained in:
amirh 2018-06-06 15:28:20 -07:00 committed by GitHub
parent fc5d44d7ac
commit 0a26ac0970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View File

@ -154,11 +154,5 @@ class _BottomAppBarClipper extends CustomClipper<Path> {
}
@override
bool shouldReclip(CustomClipper<Path> oldClipper) {
if (oldClipper.runtimeType != _BottomAppBarClipper)
return true;
final _BottomAppBarClipper typedOldClipper = oldClipper;
return typedOldClipper.geometry != geometry;
}
bool shouldReclip(_BottomAppBarClipper oldClipper) => oldClipper.geometry != geometry;
}

View File

@ -1106,7 +1106,7 @@ abstract class _RenderCustomClip<T> extends RenderProxyBox {
_clipper = newClipper;
assert(newClipper != null || oldClipper != null);
if (newClipper == null || oldClipper == null ||
oldClipper.runtimeType != oldClipper.runtimeType ||
newClipper.runtimeType != oldClipper.runtimeType ||
newClipper.shouldReclip(oldClipper)) {
_markNeedsClip();
}