Bug 1529182 - Correctly apply scale factor when clamping SVG text size. r=longsonr
authorAlex Henrie <alexhenrie24@gmail.com>
Sun, 24 Feb 2019 15:14:32 -0700
changeset 518896 2bcc26b5ecf765c47aea275da83a39b3aa8ea4a8
parent 518769 49b2a4c8be018f92d050512f9646cb3004ec1bec
child 518897 938c2d1dbf3f53f7d4f8d06572937bf3ef9aa22d
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr
bugs1529182
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1529182 - Correctly apply scale factor when clamping SVG text size. r=longsonr
layout/svg/SVGTextFrame.cpp
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -5217,21 +5217,21 @@ bool SVGTextFrame::UpdateFontSizeScaleFa
   if (minTextRunSize >= CLAMP_MIN_SIZE && maxTextRunSize <= CLAMP_MAX_SIZE) {
     // We are already in the ideal font size range for all text frames,
     // so we only have to take into account the contextScale.
     mFontSizeScaleFactor = contextScale;
   } else if (maxSize / minSize > CLAMP_MAX_SIZE / CLAMP_MIN_SIZE) {
     // We can't scale the font sizes so that all of the text frames lie
     // within our ideal font size range, so we treat the minimum as more
     // important and just scale so that minSize = CLAMP_MIN_SIZE.
-    mFontSizeScaleFactor = CLAMP_MIN_SIZE / minTextRunSize;
+    mFontSizeScaleFactor = CLAMP_MIN_SIZE / minSize;
   } else if (minTextRunSize < CLAMP_MIN_SIZE) {
-    mFontSizeScaleFactor = CLAMP_MIN_SIZE / minTextRunSize;
+    mFontSizeScaleFactor = CLAMP_MIN_SIZE / minSize;
   } else {
-    mFontSizeScaleFactor = CLAMP_MAX_SIZE / maxTextRunSize;
+    mFontSizeScaleFactor = CLAMP_MAX_SIZE / maxSize;
   }
 
   return mFontSizeScaleFactor != oldFontSizeScaleFactor;
 }
 
 double SVGTextFrame::GetFontSizeScaleFactor() const {
   return mFontSizeScaleFactor;
 }