[skottie] Make stroke width optional
TBR= Change-Id: I432a79b652ffd5838829f32980e2dcca55d57af4 Reviewed-on: https://skia-review.googlesource.com/141283 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
This commit is contained in:
parent
36848f6b30
commit
a487b0677a
@ -324,12 +324,10 @@ sk_sp<sksg::PaintNode> AttachStroke(const skjson::ObjectValue& jstroke, AttachCo
|
|||||||
|
|
||||||
stroke_node->setStyle(SkPaint::kStroke_Style);
|
stroke_node->setStyle(SkPaint::kStroke_Style);
|
||||||
|
|
||||||
auto width_attached = BindProperty<ScalarValue>(jstroke["w"], &ctx->fAnimators,
|
BindProperty<ScalarValue>(jstroke["w"], &ctx->fAnimators,
|
||||||
[stroke_node](const ScalarValue& w) {
|
[stroke_node](const ScalarValue& w) {
|
||||||
stroke_node->setStrokeWidth(w);
|
stroke_node->setStrokeWidth(w);
|
||||||
});
|
});
|
||||||
if (!width_attached)
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
stroke_node->setStrokeMiter(ParseDefault<SkScalar>(jstroke["ml"], 4.0f));
|
stroke_node->setStrokeMiter(ParseDefault<SkScalar>(jstroke["ml"], 4.0f));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user