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

Side by Side Diff: Source/core/rendering/svg/RenderSVGInlineText.cpp

Issue 508823002: Properly recompute SVG font size under zoom (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/svg/zoom/text/lowdpi-zoom-text-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
3 * Copyright (C) 2006 Apple Computer Inc. 3 * Copyright (C) 2006 Apple Computer Inc.
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
5 * Copyright (C) 2008 Rob Buis <buis@kde.org> 5 * Copyright (C) 2008 Rob Buis <buis@kde.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 computeNewScaledFontForStyle(this, style(), m_scalingFactor, m_scaledFont); 213 computeNewScaledFontForStyle(this, style(), m_scalingFactor, m_scaledFont);
214 } 214 }
215 215
216 void RenderSVGInlineText::computeNewScaledFontForStyle(RenderObject* renderer, c onst RenderStyle* style, float& scalingFactor, Font& scaledFont) 216 void RenderSVGInlineText::computeNewScaledFontForStyle(RenderObject* renderer, c onst RenderStyle* style, float& scalingFactor, Font& scaledFont)
217 { 217 {
218 ASSERT(style); 218 ASSERT(style);
219 ASSERT(renderer); 219 ASSERT(renderer);
220 220
221 // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified. 221 // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified.
222 scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFactor(re nderer); 222 scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFactor(re nderer);
223 if (scalingFactor == 1 || !scalingFactor) { 223 if (style->effectiveZoom() == 1 && (scalingFactor == 1 || !scalingFactor)) {
f(malita) 2014/08/27 12:44:31 Not related to this CL, but do you know why we res
pdr. 2014/08/27 18:09:51 I agree, this is weird. I tried converting this t
224 scalingFactor = 1; 224 scalingFactor = 1;
225 scaledFont = style->font(); 225 scaledFont = style->font();
226 return; 226 return;
227 } 227 }
228 228
229 if (style->fontDescription().textRendering() == GeometricPrecision) 229 if (style->fontDescription().textRendering() == GeometricPrecision)
230 scalingFactor = 1; 230 scalingFactor = 1;
231 231
232 FontDescription fontDescription(style->fontDescription()); 232 FontDescription fontDescription(style->fontDescription());
233 233
234 Document& document = renderer->document(); 234 Document& document = renderer->document();
235 // FIXME: We need to better handle the case when we compute very small fonts below (below 1pt). 235 // FIXME: We need to better handle the case when we compute very small fonts below (below 1pt).
236 fontDescription.setComputedSize(FontSize::getComputedSizeFromSpecifiedSize(& document, scalingFactor, fontDescription.isAbsoluteSize(), fontDescription.speci fiedSize(), DoNotUseSmartMinimumForFontSize)); 236 fontDescription.setComputedSize(FontSize::getComputedSizeFromSpecifiedSize(& document, scalingFactor, fontDescription.isAbsoluteSize(), fontDescription.speci fiedSize(), DoNotUseSmartMinimumForFontSize));
237 237
238 scaledFont = Font(fontDescription); 238 scaledFont = Font(fontDescription);
239 scaledFont.update(document.styleEngine()->fontSelector()); 239 scaledFont.update(document.styleEngine()->fontSelector());
240 } 240 }
241 241
242 } 242 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/zoom/text/lowdpi-zoom-text-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698