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

Unified Diff: Source/core/svg/SVGGraphicsElement.cpp

Issue 40293002: [SVG] Fix CSS transform handling when zoomed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | « LayoutTests/svg/zoom/page/zoom-css-transforms-expected.svg ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGGraphicsElement.cpp
diff --git a/Source/core/svg/SVGGraphicsElement.cpp b/Source/core/svg/SVGGraphicsElement.cpp
index 9da02b36d0c5be6abf56906c9b2bd9bb4be5a591..6c3e1e3bea5c2cfb6092107d6fed7b74242112fc 100644
--- a/Source/core/svg/SVGGraphicsElement.cpp
+++ b/Source/core/svg/SVGGraphicsElement.cpp
@@ -74,6 +74,14 @@ AffineTransform SVGGraphicsElement::animatedLocalTransform() const
// Flatten any 3D transform.
matrix = transform.toAffineTransform();
+
+ // CSS bakes the zoom factor into lengths, including translation components.
+ // In order to align CSS & SVG transforms, we need to invert this operation.
+ float zoom = style->effectiveZoom();
+ if (zoom != 1) {
+ matrix.setE(matrix.e() / zoom);
+ matrix.setF(matrix.f() / zoom);
+ }
} else {
transformCurrentValue().concatenate(matrix);
}
« no previous file with comments | « LayoutTests/svg/zoom/page/zoom-css-transforms-expected.svg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698