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

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

Issue 2283173003: Implement inverse & invertSelf function in DOMMatrix & DOMMatrixReadOnly. (Closed)
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
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..db646afbe8987770b3bd76662db55ddaaf987cfc 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(std::nan(""));
dominicc (has gone to gerrit) 2016/08/30 02:22:09 Hmm, I haven't done any numerical programming with
Hwanseung Lee 2016/08/30 12:47:05 Done.
+ setM12(std::nan(""));
+ setM13(std::nan(""));
+ setM14(std::nan(""));
+ setM21(std::nan(""));
+ setM22(std::nan(""));
+ setM23(std::nan(""));
+ setM24(std::nan(""));
+ setM31(std::nan(""));
+ setM32(std::nan(""));
+ setM33(std::nan(""));
+ setM34(std::nan(""));
+ setM41(std::nan(""));
+ setM42(std::nan(""));
+ setM43(std::nan(""));
+ setM44(std::nan(""));
+ setIs2D(false);
+ }
+ return this;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698