Chromium Code Reviews| Index: Source/core/dom/DOMMatrix.cpp |
| diff --git a/Source/core/dom/DOMMatrix.cpp b/Source/core/dom/DOMMatrix.cpp |
| index 4ff0491e1e74096c480b2e29c14e88638437de3e..d9d141bec0364e199af149a9d5d4d54f0fd4acac 100644 |
| --- a/Source/core/dom/DOMMatrix.cpp |
| +++ b/Source/core/dom/DOMMatrix.cpp |
| @@ -29,4 +29,30 @@ void DOMMatrix::setIs2D(bool value) |
| m_is2D = value; |
| } |
| +DOMMatrix* DOMMatrix::translateSelf(double tx, double ty, double tz) |
| +{ |
| + if (!tx && !ty && !tz) |
| + return this; |
| + |
| + if (tz) |
| + m_is2D = false; |
| + |
| + if (m_matrix.isIdentity()) { |
|
krit
2014/08/16 07:03:06
Just use translate3d() and translate() don't dupli
zino
2014/08/16 16:50:42
Okay, I agree with you. I'll remove the codes.
|
| + m_matrix.setM41(tx); |
| + m_matrix.setM42(ty); |
| + m_matrix.setM43(tz); |
| + return this; |
| + } |
| + |
| + if (m_is2D) { |
| + m_matrix.setM41(m_matrix.m41() + tx * m_matrix.m11() + ty * m_matrix.m21()); |
|
zino
2014/08/16 16:50:42
However, I think it is better to leave this codes
|
| + m_matrix.setM42(m_matrix.m42() + tx * m_matrix.m12() + ty * m_matrix.m22()); |
| + return this; |
| + } |
| + |
| + m_matrix.translate3d(tx, ty, tz); |
| + |
| + return this; |
| +} |
| + |
| } // namespace blink |