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

Unified Diff: Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp

Issue 960843003: Add a version of SVGLengthContext::valueForLength with explicit dimension (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase; Change argument order. Created 5 years, 10 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 | « no previous file | Source/core/svg/SVGLengthContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp
diff --git a/Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp b/Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp
index d40e9851017e70aecd460da0573853f80db00ce5..6cb85c6ed5c011f92346209fd0e137880d47315f 100644
--- a/Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp
+++ b/Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp
@@ -18,13 +18,11 @@
*/
#include "config.h"
-
#include "core/layout/svg/SVGTextLayoutEngineBaseline.h"
#include "core/layout/LayoutObject.h"
#include "core/layout/style/SVGLayoutStyle.h"
#include "core/layout/svg/SVGTextMetrics.h"
-#include "platform/LengthFunctions.h"
#include "platform/fonts/Font.h"
#include "platform/text/UnicodeRange.h"
@@ -40,10 +38,8 @@ float SVGTextLayoutEngineBaseline::calculateBaselineShift(const LayoutStyle& sty
const SVGLayoutStyle& svgStyle = style.svgStyle();
switch (svgStyle.baselineShift()) {
- case BS_LENGTH: {
- const float zoom = style.effectiveZoom();
- return floatValueForLength(svgStyle.baselineShiftValue(), m_font.fontDescription().computedPixelSize() * zoom) / zoom;
- }
+ case BS_LENGTH:
+ return SVGLengthContext::valueForLength(svgStyle.baselineShiftValue(), style, m_font.fontDescription().computedPixelSize());
case BS_SUB:
return -m_font.fontMetrics().floatHeight() / 2;
case BS_SUPER:
« no previous file with comments | « no previous file | Source/core/svg/SVGLengthContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698