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

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

Issue 2283173003: Implement inverse & invertSelf function in DOMMatrix & DOMMatrixReadOnly. (Closed)
Patch Set: Implement inverse & invertSelf funtion in DomMatrix & DOMMatrixReadOnly. 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
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 14a1d8e9641ce9a097c1a470bc8aea5bfbaccdcb..a76c25e6d41b6c2feb80e4c458a53bc8b4dcc44a 100644
--- a/third_party/WebKit/Source/core/dom/DOMMatrix.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMMatrix.cpp
@@ -118,4 +118,30 @@ DOMMatrix* DOMMatrix::skewYSelf(double sy)
return this;
}
+DOMMatrix* DOMMatrix::invertSelf()
+{
+ if (m_matrix->isInvertible()) {
+ m_matrix = TransformationMatrix::create(m_matrix->inverse());
+ } else {
+ setM11(NAN);
+ setM12(NAN);
+ setM13(NAN);
+ setM14(NAN);
+ setM21(NAN);
+ setM22(NAN);
+ setM23(NAN);
+ setM24(NAN);
+ setM31(NAN);
+ setM32(NAN);
+ setM33(NAN);
+ setM34(NAN);
+ setM41(NAN);
+ setM42(NAN);
+ setM43(NAN);
+ setM44(NAN);
+ setIs2D(false);
+ }
+ return this;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698