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

Unified Diff: Source/core/rendering/svg/SVGTextMetrics.cpp

Issue 652483002: TextRun::length() should return an unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 2 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/rendering/svg/SVGTextMetricsBuilder.cpp » ('j') | Source/platform/fonts/Font.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/SVGTextMetrics.cpp
diff --git a/Source/core/rendering/svg/SVGTextMetrics.cpp b/Source/core/rendering/svg/SVGTextMetrics.cpp
index 26dbc4c75075827367b4c475970eae2c5c7d077a..687c93deb5f4c1851d41985aa48d1fe1408e8eb6 100644
--- a/Source/core/rendering/svg/SVGTextMetrics.cpp
+++ b/Source/core/rendering/svg/SVGTextMetrics.cpp
@@ -50,14 +50,11 @@ SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText* textRenderer, const TextRun&
ASSERT(scalingFactor);
const Font& scaledFont = textRenderer->scaledFont();
- int length = 0;
+ m_length = 0;
// Calculate width/height using the scaled font, divide this result by the scalingFactor afterwards.
- m_width = scaledFont.width(run, length, m_glyph) / scalingFactor;
+ m_width = scaledFont.width(run, m_length, m_glyph) / scalingFactor;
m_height = scaledFont.fontMetrics().floatHeight() / scalingFactor;
-
- ASSERT(length >= 0);
- m_length = static_cast<unsigned>(length);
}
TextRun SVGTextMetrics::constructTextRun(RenderSVGInlineText* text, unsigned position, unsigned length)
« no previous file with comments | « no previous file | Source/core/rendering/svg/SVGTextMetricsBuilder.cpp » ('j') | Source/platform/fonts/Font.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698