TextStyle::matchOneAttribute compares backgrounds even if they don’t exist
Bug: skia:10432 Change-Id: I7e615de2dad82fc4a978574a4f2458e56a90e93f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301358 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Julia Lavrova <jlavrova@google.com>
This commit is contained in:
parent
babba97ae6
commit
1d784c7939
@ -120,14 +120,12 @@ bool TextStyle::equalsByFonts(const TextStyle& that) const {
|
||||
bool TextStyle::matchOneAttribute(StyleType styleType, const TextStyle& other) const {
|
||||
switch (styleType) {
|
||||
case kForeground:
|
||||
if (fHasForeground) {
|
||||
return other.fHasForeground && fForeground == other.fForeground;
|
||||
} else {
|
||||
return !other.fHasForeground && fColor == other.fColor;
|
||||
}
|
||||
return (!fHasForeground && !other.fHasForeground && fColor == other.fColor) ||
|
||||
( fHasForeground && other.fHasForeground && fForeground == other.fForeground);
|
||||
|
||||
case kBackground:
|
||||
return (fHasBackground == other.fHasBackground && fBackground == other.fBackground);
|
||||
return (!fHasBackground && !other.fHasBackground) ||
|
||||
( fHasBackground && other.fHasBackground && fBackground == other.fBackground);
|
||||
|
||||
case kShadow:
|
||||
if (fTextShadows.size() != other.fTextShadows.size()) {
|
||||
|
Loading…
Reference in New Issue
Block a user