diff options
author | Florin Malita <fmalita@chromium.org> | 2017-10-13 18:18:32 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-13 22:53:32 +0000 |
commit | e1dadd74f8a554ead3975431d6c09eb25749c904 (patch) | |
tree | 4ef0718d6809b4217d41423dc93d3832cbc5c0f0 /experimental/svg/model/SkSVGNode.cpp | |
parent | 7a0ebfc033463907e2088401972d14ea8589cdb5 (diff) |
[SVGDom] Add 'stroke-dashoffset' support
https://www.w3.org/TR/SVG/painting.html#StrokeDashoffsetProperty
Change-Id: Ia25d0048a56ac3835cabcb4e1794d91667367d7c
Reviewed-on: https://skia-review.googlesource.com/59820
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'experimental/svg/model/SkSVGNode.cpp')
-rw-r--r-- | experimental/svg/model/SkSVGNode.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/experimental/svg/model/SkSVGNode.cpp b/experimental/svg/model/SkSVGNode.cpp index 07dc59c645..c5262a0da8 100644 --- a/experimental/svg/model/SkSVGNode.cpp +++ b/experimental/svg/model/SkSVGNode.cpp @@ -94,6 +94,10 @@ void SkSVGNode::setStrokeDashArray(const SkSVGDashArray& dashArray) { fPresentationAttributes.fStrokeDashArray.set(dashArray); } +void SkSVGNode::setStrokeDashOffset(const SkSVGLength& dashOffset) { + fPresentationAttributes.fStrokeDashOffset.set(dashOffset); +} + void SkSVGNode::setStrokeOpacity(const SkSVGNumberType& opacity) { fPresentationAttributes.fStrokeOpacity.set( SkSVGNumberType(SkTPin<SkScalar>(opacity.value(), 0, 1))); @@ -149,6 +153,11 @@ void SkSVGNode::onSetAttribute(SkSVGAttribute attr, const SkSVGValue& v) { this->setStrokeDashArray(*dashArray); } break; + case SkSVGAttribute::kStrokeDashOffset: + if (const SkSVGLengthValue* dashOffset= v.as<SkSVGLengthValue>()) { + this->setStrokeDashOffset(*dashOffset); + } + break; case SkSVGAttribute::kStrokeOpacity: if (const SkSVGNumberValue* opacity = v.as<SkSVGNumberValue>()) { this->setStrokeOpacity(*opacity); |