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..9c463cea79003a4ae347877916d12e747248b22d 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,14 @@ 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, with zoom already in place on the graphical |
+ // context, we compensate back when reading values from the font |
+ // descriptor. |
+ float m_effectiveZoom; |
}; |
} // namespace blink |