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

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

Issue 2283363004: GeometryInterace: Add rotate methods. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « 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 46922eb1802a1e2124ae8cd5c68c416a4e8de863..ebb39392b44bc19755629c6fb220e6f68fc75027 100644
--- a/third_party/WebKit/Source/core/dom/DOMMatrix.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMMatrix.cpp
@@ -106,4 +106,47 @@ DOMMatrix* DOMMatrix::scaleNonUniformSelf(double sx, double sy, double sz,
return this;
}
+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, double angle)
+{
+ if (x || y)
+ m_is2D = false;
+
+ m_matrix->rotate3d(x, y, z, angle);
+ return this;
+}
+
} // namespace blink
« 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