+2007-11-15 Nikolas Zimmermann <zimmermann@kde.org>
+
+ Reviewed by Maciej.
+
+ Fix logic error: calculateGlyphBoundaries takes RTL text into account itself, no need to adjust offsets before.
+
+ * rendering/SVGInlineTextBox.cpp:
+ (WebCore::SVGInlineTextBoxClosestCharacterToPositionWalker::chunkPortionCallback):
+ (WebCore::SVGInlineTextBoxSelectionRectWalker::chunkPortionCallback):
+
2007-11-15 Anders Carlsson <andersca@apple.com>
Reviewed by Brady.
for (Vector<SVGChar>::iterator it = start; it != end; ++it) {
unsigned int newOffset = textBox->start() + (it - start) + startOffset;
+ FloatRect glyphRect = chunkCtm.mapRect(textBox->calculateGlyphBoundaries(style, newOffset, *it));
// Take RTL text into account and pick right glyph width/height.
+ // NOTE: This offset has to be corrected _after_ calling calculateGlyphBoundaries
if (textBox->m_reversed)
newOffset = textBox->start() + textBox->end() - newOffset;
- FloatRect glyphRect = chunkCtm.mapRect(textBox->calculateGlyphBoundaries(style, newOffset, *it));
-
// Calculate distances relative to the glyph mid-point. I hope this is accurate enough.
float xDistance = glyphRect.x() + glyphRect.width() / 2.0f - m_x;
float yDistance = glyphRect.y() - glyphRect.height() / 2.0f - m_y;
for (Vector<SVGChar>::iterator it = start; it != end; ++it) {
unsigned int newOffset = textBox->start() + (it - start) + startOffset;
-
- // Take RTL text into account and pick right glyph width/height.
- if (textBox->m_reversed)
- newOffset = textBox->start() + textBox->end() - newOffset;
-
m_selectionRect.unite(textBox->calculateGlyphBoundaries(style, newOffset, *it));
}