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

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

Issue 1283463003: Remove effective zoom from font metrics before length calculations (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Avoid hardcoded values in test Created 5 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 | « LayoutTests/svg/custom/zoomed-ex-em-font-sizes.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGLengthContext.cpp
diff --git a/Source/core/svg/SVGLengthContext.cpp b/Source/core/svg/SVGLengthContext.cpp
index 50e381f3e9e6e7ec4a973cc2749a37a8e21af1d0..263cc273e9b549e9c3353c9f86da17c848d34863 100644
--- a/Source/core/svg/SVGLengthContext.cpp
+++ b/Source/core/svg/SVGLengthContext.cpp
@@ -288,7 +288,7 @@ float SVGLengthContext::convertValueFromUserUnitsToCHS(float value) const
if (!style)
return 0;
- float zeroWidth = style->fontMetrics().zeroWidth();
+ float zeroWidth = style->fontMetrics().zeroWidth() / style->effectiveZoom();
if (!zeroWidth)
return 0;
@@ -301,7 +301,7 @@ float SVGLengthContext::convertValueFromCHSToUserUnits(float value) const
if (!style)
return 0;
- return value * style->fontMetrics().zeroWidth();
+ return value * style->fontMetrics().zeroWidth() / style->effectiveZoom();
}
float SVGLengthContext::convertValueFromUserUnitsToEXS(float value) const
@@ -312,7 +312,7 @@ float SVGLengthContext::convertValueFromUserUnitsToEXS(float value) const
// Use of ceil allows a pixel match to the W3Cs expected output of coords-units-03-b.svg
// if this causes problems in real world cases maybe it would be best to remove this
- float xHeight = ceilf(style->fontMetrics().xHeight());
+ float xHeight = ceilf(style->fontMetrics().xHeight() / style->effectiveZoom());
if (!xHeight)
return 0;
@@ -327,7 +327,7 @@ float SVGLengthContext::convertValueFromEXSToUserUnits(float value) const
// Use of ceil allows a pixel match to the W3Cs expected output of coords-units-03-b.svg
// if this causes problems in real world cases maybe it would be best to remove this
- return value * ceilf(style->fontMetrics().xHeight());
+ return value * ceilf(style->fontMetrics().xHeight() / style->effectiveZoom());
}
bool SVGLengthContext::determineViewport(FloatSize& viewportSize) const
« no previous file with comments | « LayoutTests/svg/custom/zoomed-ex-em-font-sizes.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698