OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/dom/DOMMatrix.h" | 6 #include "core/dom/DOMMatrix.h" |
7 | 7 |
8 namespace blink { | 8 namespace blink { |
9 | 9 |
10 DOMMatrix* DOMMatrix::create() | 10 DOMMatrix* DOMMatrix::create() |
(...skipping 11 matching lines...) Expand all Loading... |
22 m_matrix = matrix; | 22 m_matrix = matrix; |
23 m_is2D = is2D; | 23 m_is2D = is2D; |
24 } | 24 } |
25 | 25 |
26 void DOMMatrix::setIs2D(bool value) | 26 void DOMMatrix::setIs2D(bool value) |
27 { | 27 { |
28 if (m_is2D) | 28 if (m_is2D) |
29 m_is2D = value; | 29 m_is2D = value; |
30 } | 30 } |
31 | 31 |
| 32 DOMMatrix* DOMMatrix::translateSelf(double tx, double ty, double tz) |
| 33 { |
| 34 if (!tx && !ty && !tz) |
| 35 return this; |
| 36 |
| 37 if (tz) |
| 38 m_is2D = false; |
| 39 |
| 40 if (m_is2D) |
| 41 m_matrix.translate(tx, ty); |
| 42 else |
| 43 m_matrix.translate3d(tx, ty, tz); |
| 44 |
| 45 return this; |
| 46 } |
| 47 |
32 } // namespace blink | 48 } // namespace blink |
OLD | NEW |