Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(643)

Unified Diff: Source/core/dom/DOMMatrix.cpp

Issue 446803002: Implement translate() and translateSelf() in DOMMatrix. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/DOMMatrix.h ('k') | Source/core/dom/DOMMatrix.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMMatrix.cpp
diff --git a/Source/core/dom/DOMMatrix.cpp b/Source/core/dom/DOMMatrix.cpp
index 4ff0491e1e74096c480b2e29c14e88638437de3e..38e20ac40d0582b01f05ec5f3edcdcdaca1adf4d 100644
--- a/Source/core/dom/DOMMatrix.cpp
+++ b/Source/core/dom/DOMMatrix.cpp
@@ -29,4 +29,20 @@ 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_is2D)
+ m_matrix.translate(tx, ty);
+ else
+ m_matrix.translate3d(tx, ty, tz);
+
+ return this;
+}
+
} // namespace blink
« no previous file with comments | « Source/core/dom/DOMMatrix.h ('k') | Source/core/dom/DOMMatrix.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698