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

Unified Diff: third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp

Issue 2342913003: Replace narrowPrecisionToFloat with clampTo<float> (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp b/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp
index 7662bbf8dc9464bc0c9e57da296720ed4567b917..197e8a1155823d2b3abcf92d9f34f84e4f299100 100644
--- a/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp
@@ -26,7 +26,7 @@
#include "core/layout/api/LineLayoutSVGInlineText.h"
#include "core/layout/svg/LayoutSVGInlineText.h"
#include "core/paint/SVGInlineTextBoxPainter.h"
-#include "platform/FloatConversion.h"
+#include "wtf/MathExtras.h"
namespace blink {
@@ -81,7 +81,7 @@ int SVGInlineTextBox::offsetForPositionInFragment(const SVGTextFragment& fragmen
// FIXME: Handle vertical text.
if (fragment.isTransformed()) {
AffineTransform fragmentTransform = fragment.buildFragmentTransform();
- textRun.setHorizontalGlyphStretch(narrowPrecisionToFloat(fragmentTransform.xScale()));
+ textRun.setHorizontalGlyphStretch(clampTo<float>(fragmentTransform.xScale()));
}
return fragment.characterOffset - start() + lineLayoutItem.scaledFont().offsetForPosition(textRun, position * scalingFactor, includePartialGlyphs);

Powered by Google App Engine
This is Rietveld 408576698