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

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

Issue 479863002: Implement rotate*() methods in DOMMatrix. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add rotateFromVector and rotateAxisAngle 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 75cefcb63fe9bf945653424bb609bba356e300b0..37e100e5402f5222c39ce4115ef9276a3191f937 100644
--- a/Source/core/dom/DOMMatrix.cpp
+++ b/Source/core/dom/DOMMatrix.cpp
@@ -80,4 +80,37 @@ DOMMatrix* DOMMatrix::scaleNonUniformSelf(double sx, double sy, double sz,
return this;
}
+DOMMatrix* DOMMatrix::rotateSelf(double angle, double ox, double oy)
+{
+ bool hasTranslation = (ox || oy);
+
+ if (hasTranslation)
+ translateSelf(ox, oy);
+
+ m_matrix.rotate(angle);
+
+ if (hasTranslation)
+ translateSelf(-ox, -oy);
+
+ return this;
+}
+
+DOMMatrix* DOMMatrix::rotateFromVectorSelf(double x, double y)
+{
+ m_matrix.rotateFromVector(x, y);
+
+ return this;
+}
+
+DOMMatrix* DOMMatrix::rotateAxisAngleSelf(
+ double x, double y, double z, double angle)
+{
+ if (x != 0 || y != 0)
zino 2014/08/17 15:32:50 http://dev.w3.org/fxtf/geometry/#dom-dommatrix-rot
+ m_is2D = false;
+
+ m_matrix.rotate3d(x, y, z, angle);
+
+ 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