Fix placeholders in cache

Change-Id: I36d488aa7a554131b8e524beeabc4ca9f5777591
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267696
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
diff --git a/modules/skparagraph/src/TextStyle.cpp b/modules/skparagraph/src/TextStyle.cpp
index 1cae43d..12e2de4 100644
--- a/modules/skparagraph/src/TextStyle.cpp
+++ b/modules/skparagraph/src/TextStyle.cpp
@@ -183,7 +183,8 @@
            SkScalarNearlyEqual(fHeight, other.fHeight) &&
            fAlignment == other.fAlignment &&
            fBaseline == other.fBaseline &&
-           SkScalarNearlyEqual(fBaselineOffset, other.fBaselineOffset);
+           (fAlignment != PlaceholderAlignment::kBaseline ||
+            SkScalarNearlyEqual(fBaselineOffset, other.fBaselineOffset));
 }
 
 }  // namespace textlayout