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

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

Issue 2444733002: [GeometryInterface] Add rotate*(), rotateFromVector*() function. (Closed)
Patch Set: update test file. Created 4 years, 2 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 | « third_party/WebKit/Source/core/dom/DOMMatrix.h ('k') | third_party/WebKit/Source/core/dom/DOMMatrix.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/DOMMatrix.cpp
diff --git a/third_party/WebKit/Source/core/dom/DOMMatrix.cpp b/third_party/WebKit/Source/core/dom/DOMMatrix.cpp
index 0e77259c9af33e0ffc0c6bc1bd47d0ce23edab1a..966810654a5eed9950886b24b46a341f051a327b 100644
--- a/third_party/WebKit/Source/core/dom/DOMMatrix.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMMatrix.cpp
@@ -183,6 +183,36 @@ DOMMatrix* DOMMatrix::scale3dSelf(double scale,
return scaleSelf(scale, scale, scale, ox, oy, oz);
}
+DOMMatrix* DOMMatrix::rotateSelf(double rotX) {
+ return rotateSelf(0, 0, rotX);
+}
+
+DOMMatrix* DOMMatrix::rotateSelf(double rotX, double rotY) {
+ return rotateSelf(rotX, rotY, 0);
+}
+
+DOMMatrix* DOMMatrix::rotateSelf(double rotX, double rotY, double rotZ) {
+ if (rotZ)
+ m_matrix->rotate3d(0, 0, 1, rotZ);
+
+ if (rotY) {
+ m_matrix->rotate3d(0, 1, 0, rotY);
+ m_is2D = false;
+ }
+
+ if (rotX) {
+ m_matrix->rotate3d(1, 0, 0, rotX);
+ m_is2D = false;
+ }
+
+ return this;
+}
+
+DOMMatrix* DOMMatrix::rotateFromVectorSelf(double x, double y) {
+ m_matrix->rotate(rad2deg(atan2(y, x)));
+ return this;
+}
+
DOMMatrix* DOMMatrix::rotateAxisAngleSelf(double x,
double y,
double z,
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMMatrix.h ('k') | third_party/WebKit/Source/core/dom/DOMMatrix.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698