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

Unified Diff: Source/core/rendering/svg/RenderSVGInlineText.cpp

Issue 18190003: Account for zoom when computing SVG font size. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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/text/zoom-text-and-geometry-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGInlineText.cpp
diff --git a/Source/core/rendering/svg/RenderSVGInlineText.cpp b/Source/core/rendering/svg/RenderSVGInlineText.cpp
index 865e569ca63c04466105f0cc16d445a3af2d64e0..626bdc7ae91e9d4835224f855609c24a2c82980c 100644
--- a/Source/core/rendering/svg/RenderSVGInlineText.cpp
+++ b/Source/core/rendering/svg/RenderSVGInlineText.cpp
@@ -225,18 +225,21 @@ void RenderSVGInlineText::computeNewScaledFontForStyle(RenderObject* renderer, c
StyleResolver* styleResolver = document->styleResolver();
ASSERT(styleResolver);
- // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified
+ // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified.
Stephen Chennney 2013/07/08 13:16:28 Save a little work. scalingFactor = 1; if (...tex
scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFactor(renderer);
- if (scalingFactor == 1 || !scalingFactor || style->fontDescription().textRenderingMode() == GeometricPrecision) {
+ if (scalingFactor == 1 || !scalingFactor) {
scalingFactor = 1;
scaledFont = style->font();
return;
}
+ if (style->fontDescription().textRenderingMode() == GeometricPrecision)
+ scalingFactor = 1;
+
FontDescription fontDescription(style->fontDescription());
// FIXME: We need to better handle the case when we compute very small fonts below (below 1pt).
- fontDescription.setComputedSize(FontSize::getComputedSizeFromSpecifiedSize(document, scalingFactor, fontDescription.isAbsoluteSize(), fontDescription.computedSize(), DoNotUseSmartMinimumForFontSize));
+ fontDescription.setComputedSize(FontSize::getComputedSizeFromSpecifiedSize(document, scalingFactor, fontDescription.isAbsoluteSize(), fontDescription.specifiedSize(), DoNotUseSmartMinimumForFontSize));
scaledFont = Font(fontDescription, 0, 0);
scaledFont.update(styleResolver->fontSelector());
« no previous file with comments | « LayoutTests/svg/zoom/text/zoom-text-and-geometry-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698