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

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

Issue 1825613005: More explicit SVGTextMetrics construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@svg-metrics-cleanup-2
Patch Set: Created 4 years, 9 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/SVGTextMetrics.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp
index 4dad1811862aebd0465376caff1b8c373fd49aec..3614a6f6c49f1eec7fd818344994335e681d17ec 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp
@@ -19,7 +19,6 @@
#include "core/layout/svg/SVGTextMetrics.h"
-#include "core/layout/api/LineLayoutSVGInlineText.h"
#include "platform/fonts/FontOrientation.h"
namespace blink {
@@ -31,24 +30,16 @@ SVGTextMetrics::SVGTextMetrics()
{
}
-SVGTextMetrics::SVGTextMetrics(SVGTextMetrics::MetricsType)
- : m_width(0)
- , m_height(0)
- , m_length(1)
+SVGTextMetrics::SVGTextMetrics(unsigned length, float width, float height)
+ : m_width(width)
+ , m_height(height)
+ , m_length(length)
{
}
-SVGTextMetrics::SVGTextMetrics(LineLayoutSVGInlineText textLayoutItem, unsigned length, float width)
+SVGTextMetrics::SVGTextMetrics(SVGTextMetrics::MetricsType)
+ : SVGTextMetrics(1, 0, 0)
{
- ASSERT(textLayoutItem);
-
- float scalingFactor = textLayoutItem.scalingFactor();
- ASSERT(scalingFactor);
-
- m_width = width / scalingFactor;
- m_height = textLayoutItem.scaledFont().getFontMetrics().floatHeight() / scalingFactor;
-
- m_length = length;
}
float SVGTextMetrics::advance(FontOrientation orientation) const

Powered by Google App Engine
This is Rietveld 408576698