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

Unified Diff: Source/platform/fonts/WidthIterator.cpp

Issue 180893004: Adjust both x and y position when drawing glyphs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: w/mac fix Created 6 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
« no previous file with comments | « Source/platform/fonts/GlyphBuffer.h ('k') | Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/WidthIterator.cpp
diff --git a/Source/platform/fonts/WidthIterator.cpp b/Source/platform/fonts/WidthIterator.cpp
index 4bf89a4749c080461bc15b075642ae7634363f86..13dae23e3c1bebd14bbf58da08a7320166dd882c 100644
--- a/Source/platform/fonts/WidthIterator.cpp
+++ b/Source/platform/fonts/WidthIterator.cpp
@@ -246,9 +246,12 @@ inline unsigned WidthIterator::advanceInternal(TextIterator& textIterator, Glyph
m_isAfterExpansion = false;
}
- if (shouldApplyFontTransforms() && glyphBuffer && Character::treatAsSpace(character))
+ if (shouldApplyFontTransforms() && glyphBuffer && Character::treatAsSpace(character)) {
charactersTreatedAsSpace.append(make_pair(glyphBuffer->size(),
- OriginalAdvancesForCharacterTreatedAsSpace(character == ' ', glyphBuffer->size() ? glyphBuffer->advanceAt(glyphBuffer->size() - 1) : 0, width)));
+ OriginalAdvancesForCharacterTreatedAsSpace(character == ' ',
+ glyphBuffer->size() ? glyphBuffer->advanceAt(glyphBuffer->size() - 1).width() : 0,
+ width)));
+ }
if (m_accountForGlyphBounds) {
bounds = fontData->boundsForGlyph(glyph);
@@ -337,7 +340,7 @@ bool WidthIterator::advanceOneCharacter(float& width, GlyphBuffer& glyphBuffer)
advance(m_currentCharacter + 1, &glyphBuffer);
float w = 0;
for (unsigned i = oldSize; i < glyphBuffer.size(); ++i)
- w += glyphBuffer.advanceAt(i);
+ w += glyphBuffer.advanceAt(i).width();
width = w;
return glyphBuffer.size() > oldSize;
}
« no previous file with comments | « Source/platform/fonts/GlyphBuffer.h ('k') | Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698