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

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

Issue 1505713002: Include glyph overflow in SVG text bounding boxes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More expectations Created 5 years 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 | « third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1deca53cdaf45da4e7af940948e64128e634a04b..785605152f656bc3280755def0e6bcbcd458357f 100644
--- a/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp
@@ -240,7 +240,12 @@ LayoutRect SVGInlineTextBox::calculateBoundaries() const
unsigned textFragmentsSize = m_textFragments.size();
for (unsigned i = 0; i < textFragmentsSize; ++i) {
const SVGTextFragment& fragment = m_textFragments.at(i);
- FloatRect fragmentRect(fragment.x, fragment.y - baseline, fragment.width, fragment.height);
+
+ FloatRect fragmentRect(
+ fragment.x - fragment.glyphOverflowLeft,
+ fragment.y - baseline - fragment.glyphOverflowTop,
+ fragment.width + fragment.glyphOverflowLeft + fragment.glyphOverflowRight,
+ fragment.height + fragment.glyphOverflowTop + fragment.glyphOverflowBottom);
fragment.buildFragmentTransform(fragmentTransform);
fragmentRect = fragmentTransform.mapRect(fragmentRect);
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698