-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Don't relayout a Text if only its color changed. #11313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| switch (_textPainter.text.compareTo(value)) { | ||
| case RenderComparison.identical: | ||
| case RenderComparison.metadata: | ||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a return here but a break below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accident of how i wrote the code, though i can justify it post-hoc: the "return" is an early return (nothing changed, bail out), whereas the other two branches are actually doing something. If we ever add something after the switch, I'd expect the identical/metadata cases to do nothing, but the other cases to do it.
|
LGTM. Nice use of enum.index. |
| /// For example, [layout] (index 3) implies [paint] (2). | ||
| enum RenderComparison { | ||
| /// The two objects are identical (meaning deeply equal, not necessarily | ||
| /// [identical]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just hyperlinks right back to this enum value (as seen on https://master-docs-flutter-io.firebaseapp.com/flutter/painting/RenderComparison-class.html)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops. I guess I want [dart:io.identical]. (cc @jcollins-g)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully fixed in #11330
No description provided.