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

Unified Diff: Source/core/layout/line/BreakingContextInlineHeaders.h

Issue 1204783002: Fix glyph overflow with word-spacing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | « LayoutTests/fast/text/glyph-overflow-with-word-spacing-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/line/BreakingContextInlineHeaders.h
diff --git a/Source/core/layout/line/BreakingContextInlineHeaders.h b/Source/core/layout/line/BreakingContextInlineHeaders.h
index a33c7bb57207c4f5f2262173fe2ab28b993a9ff7..071144e8c583c621449a112cf33ff9d60b84f3bb 100644
--- a/Source/core/layout/line/BreakingContextInlineHeaders.h
+++ b/Source/core/layout/line/BreakingContextInlineHeaders.h
@@ -644,6 +644,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool
additionalTempWidth = textWidth(layoutText, lastSpace, m_current.offset() - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, &wordMeasurement.fallbackFonts, &wordMeasurement.glyphBounds);
wordMeasurement.width = additionalTempWidth + wordSpacingForWordMeasurement;
+ wordMeasurement.glyphBounds.move(wordSpacingForWordMeasurement, 0);
additionalTempWidth += lastSpaceWordSpacing;
m_width.addUncommittedWidth(additionalTempWidth);
@@ -801,10 +802,14 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool
wordMeasurement.layoutText = layoutText;
// IMPORTANT: current.m_pos is > length here!
- float additionalTempWidth = m_ignoringSpaces ? 0 : textWidth(layoutText, lastSpace, m_current.offset() - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, &wordMeasurement.fallbackFonts, &wordMeasurement.glyphBounds);
+ float additionalTempWidth = 0;
wordMeasurement.startOffset = lastSpace;
wordMeasurement.endOffset = m_current.offset();
- wordMeasurement.width = m_ignoringSpaces ? 0 : additionalTempWidth + wordSpacingForWordMeasurement;
+ if (!m_ignoringSpaces) {
+ additionalTempWidth = textWidth(layoutText, lastSpace, m_current.offset() - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, &wordMeasurement.fallbackFonts, &wordMeasurement.glyphBounds);
+ wordMeasurement.width = additionalTempWidth + wordSpacingForWordMeasurement;
+ wordMeasurement.glyphBounds.move(wordSpacingForWordMeasurement, 0);
+ }
additionalTempWidth += lastSpaceWordSpacing;
LayoutUnit inlineLogicalTempWidth = inlineLogicalWidth(m_current.object(), !m_appliedStartWidth, m_includeEndWidth);
« no previous file with comments | « LayoutTests/fast/text/glyph-overflow-with-word-spacing-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698