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

Unified Diff: third_party/WebKit/Source/platform/transforms/TransformationMatrix.cpp

Issue 2482753002: Fix matrix3d transform under page zoom (Closed)
Patch Set: Add a comment for zoom Created 4 years, 1 month 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/platform/transforms/TransformationMatrix.cpp
diff --git a/third_party/WebKit/Source/platform/transforms/TransformationMatrix.cpp b/third_party/WebKit/Source/platform/transforms/TransformationMatrix.cpp
index f0cb81c6acf0e700198ea9a2705f3f1dab08d365..6b7411b86608e5764f5b816337ce6dce6bfc4aa7 100644
--- a/third_party/WebKit/Source/platform/transforms/TransformationMatrix.cpp
+++ b/third_party/WebKit/Source/platform/transforms/TransformationMatrix.cpp
@@ -1266,6 +1266,16 @@ TransformationMatrix& TransformationMatrix::applyTransformOrigin(double x,
return *this;
}
+TransformationMatrix& TransformationMatrix::zoom(double zoomFactor) {
+ m_matrix[0][3] /= zoomFactor;
+ m_matrix[1][3] /= zoomFactor;
+ m_matrix[2][3] /= zoomFactor;
+ m_matrix[3][0] *= zoomFactor;
+ m_matrix[3][1] *= zoomFactor;
+ m_matrix[3][2] *= zoomFactor;
+ return *this;
+}
+
// Calculates *this = *this * mat.
// Note: A * B means that the transforms represented by A happen first, and
// then the transforms represented by B. That is, the matrix A * B corresponds

Powered by Google App Engine
This is Rietveld 408576698