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

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

Issue 1081813003: Remove effective zoom from font metrics before SVG text layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update expectations Created 5 years, 8 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
Index: Source/core/layout/svg/SVGTextLayoutEngineBaseline.h
diff --git a/Source/core/layout/svg/SVGTextLayoutEngineBaseline.h b/Source/core/layout/svg/SVGTextLayoutEngineBaseline.h
index 96e3325c05ba5e0d513eeb9a152439da2210809d..d7497c794a797aeaa70cdf7593a5c9c7caad6292 100644
--- a/Source/core/layout/svg/SVGTextLayoutEngineBaseline.h
+++ b/Source/core/layout/svg/SVGTextLayoutEngineBaseline.h
@@ -36,7 +36,7 @@ class SVGTextMetrics;
class SVGTextLayoutEngineBaseline {
WTF_MAKE_NONCOPYABLE(SVGTextLayoutEngineBaseline);
public:
- SVGTextLayoutEngineBaseline(const Font&);
+ SVGTextLayoutEngineBaseline(const Font&, float effectiveZoom);
float calculateBaselineShift(const ComputedStyle&) const;
float calculateAlignmentBaselineShift(bool isVerticalText, const LayoutObject* textRenderer) const;
@@ -47,6 +47,11 @@ private:
EAlignmentBaseline dominantBaselineToAlignmentBaseline(bool isVerticalText, const LayoutObject* textRenderer) const;
const Font& m_font;
+
+ // Everything we read from the m_font's font descriptor during layout is scaled by the effective
+ // zoom, as fonts always are in computed style. Since layout inside SVG takes place in unzoomed
+ // coordinates we have to compensate for zoom when reading values from the font descriptor.
+ float m_effectiveZoom;
};
} // namespace blink
« no previous file with comments | « Source/core/layout/svg/SVGTextLayoutEngine.cpp ('k') | Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698