OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010-2012. 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 lineLayout.m_textLengthSpacingInEffect = m_textLengthSpacingInEffect; | 170 lineLayout.m_textLengthSpacingInEffect = m_textLengthSpacingInEffect; |
171 lineLayout.layoutCharactersInTextBoxes(flowBox); | 171 lineLayout.layoutCharactersInTextBoxes(flowBox); |
172 | 172 |
173 m_inPathLayout = true; | 173 m_inPathLayout = true; |
174 LayoutSVGTextPath* textPath = &toLayoutSVGTextPath(flowBox->layoutObject()); | 174 LayoutSVGTextPath* textPath = &toLayoutSVGTextPath(flowBox->layoutObject()); |
175 | 175 |
176 Path path = textPath->layoutPath(); | 176 Path path = textPath->layoutPath(); |
177 if (path.isEmpty()) | 177 if (path.isEmpty()) |
178 return; | 178 return; |
179 m_textPathCalculator = new Path::PositionCalculator(path); | 179 m_textPathCalculator = new Path::PositionCalculator(path); |
180 m_textPathStartOffset = textPath->startOffset(); | |
181 m_textPathLength = path.length(); | 180 m_textPathLength = path.length(); |
182 if (m_textPathStartOffset > 0 && m_textPathStartOffset <= 1) | 181 m_textPathStartOffset = textPath->calculateStartOffset(m_textPathLength); |
183 m_textPathStartOffset *= m_textPathLength; | |
184 | 182 |
185 SVGTextPathChunkBuilder textPathChunkLayoutBuilder; | 183 SVGTextPathChunkBuilder textPathChunkLayoutBuilder; |
186 textPathChunkLayoutBuilder.processTextChunks(lineLayout.m_lineLayoutBoxes); | 184 textPathChunkLayoutBuilder.processTextChunks(lineLayout.m_lineLayoutBoxes); |
187 | 185 |
188 m_textPathStartOffset += textPathChunkLayoutBuilder.totalTextAnchorShift(); | 186 m_textPathStartOffset += textPathChunkLayoutBuilder.totalTextAnchorShift(); |
189 m_textPathCurrentOffset = m_textPathStartOffset; | 187 m_textPathCurrentOffset = m_textPathStartOffset; |
190 | 188 |
191 // Eventually handle textLength adjustments. | 189 // Eventually handle textLength adjustments. |
192 SVGLengthAdjustType lengthAdjust = SVGLengthAdjustUnknown; | 190 SVGLengthAdjustType lengthAdjust = SVGLengthAdjustUnknown; |
193 float desiredTextLength = 0; | 191 float desiredTextLength = 0; |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 } | 550 } |
553 | 551 |
554 if (!didStartTextFragment) | 552 if (!didStartTextFragment) |
555 return; | 553 return; |
556 | 554 |
557 // Close last open fragment, if needed. | 555 // Close last open fragment, if needed. |
558 recordTextFragment(textBox); | 556 recordTextFragment(textBox); |
559 } | 557 } |
560 | 558 |
561 } // namespace blink | 559 } // namespace blink |
OLD | NEW |