OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 processTextChunk(m_textChunks[i]); | 78 processTextChunk(m_textChunks[i]); |
79 | 79 |
80 m_textChunks.clear(); | 80 m_textChunks.clear(); |
81 } | 81 } |
82 | 82 |
83 void SVGTextChunkBuilder::addTextChunk(Vector<SVGInlineTextBox*>& lineLayoutBoxe
s, unsigned boxStart, unsigned boxCount) | 83 void SVGTextChunkBuilder::addTextChunk(Vector<SVGInlineTextBox*>& lineLayoutBoxe
s, unsigned boxStart, unsigned boxCount) |
84 { | 84 { |
85 SVGInlineTextBox* textBox = lineLayoutBoxes[boxStart]; | 85 SVGInlineTextBox* textBox = lineLayoutBoxes[boxStart]; |
86 ASSERT(textBox); | 86 ASSERT(textBox); |
87 | 87 |
88 RenderSVGInlineText& textRenderer = toRenderSVGInlineText(textBox->textRende
rer()); | 88 RenderSVGInlineText& textRenderer = toRenderSVGInlineText(textBox->renderer(
)); |
89 | 89 |
90 const RenderStyle* style = toRenderSVGInlineText(textBox->textRenderer()).st
yle(); | 90 const RenderStyle* style = toRenderSVGInlineText(textBox->renderer()).style(
); |
91 ASSERT(style); | 91 ASSERT(style); |
92 | 92 |
93 const SVGRenderStyle& svgStyle = style->svgStyle(); | 93 const SVGRenderStyle& svgStyle = style->svgStyle(); |
94 | 94 |
95 // Build chunk style flags. | 95 // Build chunk style flags. |
96 unsigned chunkStyle = SVGTextChunk::DefaultStyle; | 96 unsigned chunkStyle = SVGTextChunk::DefaultStyle; |
97 | 97 |
98 // Handle 'direction' property. | 98 // Handle 'direction' property. |
99 if (!style->isLeftToRightDirection()) | 99 if (!style->isLeftToRightDirection()) |
100 chunkStyle |= SVGTextChunk::RightToLeftText; | 100 chunkStyle |= SVGTextChunk::RightToLeftText; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 SVGTextFragment& fragment = fragments[i]; | 248 SVGTextFragment& fragment = fragments[i]; |
249 | 249 |
250 if (isVerticalText) | 250 if (isVerticalText) |
251 fragment.y += textAnchorShift; | 251 fragment.y += textAnchorShift; |
252 else | 252 else |
253 fragment.x += textAnchorShift; | 253 fragment.x += textAnchorShift; |
254 } | 254 } |
255 } | 255 } |
256 | 256 |
257 } | 257 } |
OLD | NEW |