OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #include "SkSVGTransformableNode.h" |
| 9 #include "SkSVGValue.h" |
| 10 |
| 11 SkSVGTransformableNode::SkSVGTransformableNode(SkSVGTag tag) |
| 12 : INHERITED(tag) |
| 13 , fMatrix(SkMatrix::I()) { } |
| 14 |
| 15 void SkSVGTransformableNode::onSetAttribute(SkSVGAttribute attr, const SkSVGValu
e& v) { |
| 16 switch (attr) { |
| 17 case SkSVGAttribute::transform: |
| 18 if (const auto* transform = v.as<SkSVGTransformValue>()) { |
| 19 this->setTransform(*transform); |
| 20 } |
| 21 break; |
| 22 default: |
| 23 this->INHERITED::onSetAttribute(attr, v); |
| 24 break; |
| 25 } |
| 26 } |
OLD | NEW |