Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit a3e8266

Browse files
fmalitaSkia Commit-Bot
authored andcommitted
[skottie] Add warning for missing text/paragraph box
Text auto-scaling requires an explicit paragraph box. Change-Id: If3ba91051cd5fa8456fc8530d7ed7ad4c663fff9 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272119 Commit-Queue: Florin Malita <[email protected]> Commit-Queue: Ben Wagner <[email protected]> Auto-Submit: Florin Malita <[email protected]> Reviewed-by: Ben Wagner <[email protected]>
1 parent b6c2bb0 commit a3e8266

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/skottie/src/text/TextValue.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ bool ValueTraits<TextValue>::FromJSON(const skjson::Value& jv,
111111
}
112112
}
113113

114+
if (v->fResize != Shaper::ResizePolicy::kNone && v->fBox.isEmpty()) {
115+
abuilder->log(Logger::Level::kWarning, jtxt, "Auto-scaled text requires a paragraph box.");
116+
v->fResize = Shaper::ResizePolicy::kNone;
117+
}
118+
114119
const auto& parse_color = [] (const skjson::ArrayValue* jcolor,
115120
const internal::AnimationBuilder* abuilder,
116121
SkColor* c) {

0 commit comments

Comments
 (0)