| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 ASSERT(run.charactersLength() >= run.length()); | 83 ASSERT(run.charactersLength() >= run.length()); |
| 84 return run; | 84 return run; |
| 85 } | 85 } |
| 86 | 86 |
| 87 SVGTextMetrics SVGTextMetrics::measureCharacterRange(LayoutSVGInlineText* text,
unsigned position, unsigned length, TextDirection textDirection) | 87 SVGTextMetrics SVGTextMetrics::measureCharacterRange(LayoutSVGInlineText* text,
unsigned position, unsigned length, TextDirection textDirection) |
| 88 { | 88 { |
| 89 ASSERT(text); | 89 ASSERT(text); |
| 90 return SVGTextMetrics(text, constructTextRun(text, position, length, textDir
ection)); | 90 return SVGTextMetrics(text, constructTextRun(text, position, length, textDir
ection)); |
| 91 } | 91 } |
| 92 | 92 |
| 93 SVGTextMetrics::SVGTextMetrics(LayoutSVGInlineText* text, unsigned position, uns
igned length, float width) | 93 SVGTextMetrics::SVGTextMetrics(LayoutSVGInlineText* text, unsigned length, float
width) |
| 94 { | 94 { |
| 95 ASSERT(text); | 95 ASSERT(text); |
| 96 | 96 |
| 97 float scalingFactor = text->scalingFactor(); | 97 float scalingFactor = text->scalingFactor(); |
| 98 ASSERT(scalingFactor); | 98 ASSERT(scalingFactor); |
| 99 | 99 |
| 100 m_width = width / scalingFactor; | 100 m_width = width / scalingFactor; |
| 101 m_height = text->scaledFont().fontMetrics().floatHeight() / scalingFactor; | 101 m_height = text->scaledFont().fontMetrics().floatHeight() / scalingFactor; |
| 102 | 102 |
| 103 m_length = length; | 103 m_length = length; |
| 104 } | 104 } |
| 105 | 105 |
| 106 } | 106 } |
| OLD | NEW |