diff options
Diffstat (limited to 'WebCore/platform/graphics/chromium/FontLinux.cpp')
-rw-r--r-- | WebCore/platform/graphics/chromium/FontLinux.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp index 82b9df7..79b2caf 100644 --- a/WebCore/platform/graphics/chromium/FontLinux.cpp +++ b/WebCore/platform/graphics/chromium/FontLinux.cpp @@ -341,6 +341,7 @@ void TextRunWalker::setPadding(int padding) // amount to each space. The last space gets the smaller amount, if // any. unsigned numWordBreaks = 0; + bool isRTL = m_iterateBackwards; for (unsigned i = 0; i < m_item.stringLength; i++) { if (isWordBreak(i)) @@ -523,7 +524,7 @@ void TextRunWalker::setGlyphXPositions(bool isRTL) // Whitespace must be laid out in logical order, so when inserting // spaces in RTL (but iterating in LTR order) we must insert spaces // _before_ the next glyph. - if (static_cast<unsigned>(i + 1) >= m_item.num_glyphs || m_item.attributes[i + 1].clusterStart) + if (i + 1 >= m_item.num_glyphs || m_item.attributes[i + 1].clusterStart) position += m_letterSpacing; position += determineWordBreakSpacing(logClustersIndex); @@ -540,7 +541,7 @@ void TextRunWalker::setGlyphXPositions(bool isRTL) position += truncateFixedPointToInteger(m_item.advances[i]); } } else { - for (size_t i = 0; i < m_item.num_glyphs; ++i) { + for (int i = 0; i < m_item.num_glyphs; ++i) { m_glyphs16[i] = m_item.glyphs[i]; double offsetX = truncateFixedPointToInteger(m_item.offsets[i].x); m_xPositions[i] = m_offsetX + position + offsetX; @@ -555,7 +556,7 @@ void TextRunWalker::setGlyphXPositions(bool isRTL) if (m_item.attributes[i].clusterStart) advance += m_letterSpacing; - while (static_cast<unsigned>(logClustersIndex) < m_item.item.length && logClusters()[logClustersIndex] == i) + while (logClustersIndex < m_item.item.length && logClusters()[logClustersIndex] == i) logClustersIndex++; position += advance; @@ -707,7 +708,7 @@ static int glyphIndexForXPositionInScriptRun(const TextRunWalker& walker, int x) for (glyphIndex = walker.length() - 1; glyphIndex >= 0; --glyphIndex) { // When iterating LTR over RTL text, we must include the whitespace // _before_ the glyph, so no + 1 here. - if (x < (static_cast<int>(walker.length()) - glyphIndex) * letterSpacing + truncateFixedPointToInteger(advances[glyphIndex])) + if (x < (walker.length() - glyphIndex) * letterSpacing + truncateFixedPointToInteger(advances[glyphIndex])) break; x -= truncateFixedPointToInteger(advances[glyphIndex]); } |