OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 2609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2620 } | 2620 } |
2621 | 2621 |
2622 wordMeasurements.grow(wordMeasurements.size() + 1); | 2622 wordMeasurements.grow(wordMeasurements.size() + 1); |
2623 WordMeasurement& wordMeasurement = wordMeasurements.last(); | 2623 WordMeasurement& wordMeasurement = wordMeasurements.last(); |
2624 | 2624 |
2625 wordMeasurement.renderer = t; | 2625 wordMeasurement.renderer = t; |
2626 wordMeasurement.endOffset = current.m_pos; | 2626 wordMeasurement.endOffset = current.m_pos; |
2627 wordMeasurement.startOffset = lastSpace; | 2627 wordMeasurement.startOffset = lastSpace; |
2628 | 2628 |
2629 float additionalTmpW; | 2629 float additionalTmpW; |
2630 if (wordTrailingSpaceWidth && currentCharacterIsSpace) | 2630 if (wordTrailingSpaceWidth && c == ' ') |
2631 additionalTmpW = textWidth(t, lastSpace, current.m_pos +
1 - lastSpace, f, width.currentWidth(), isFixedPitch, collapseWhiteSpace, &word
Measurement.fallbackFonts, textLayout) - wordTrailingSpaceWidth; | 2631 additionalTmpW = textWidth(t, lastSpace, current.m_pos +
1 - lastSpace, f, width.currentWidth(), isFixedPitch, collapseWhiteSpace, &word
Measurement.fallbackFonts, textLayout) - wordTrailingSpaceWidth; |
2632 else | 2632 else |
2633 additionalTmpW = textWidth(t, lastSpace, current.m_pos -
lastSpace, f, width.currentWidth(), isFixedPitch, collapseWhiteSpace, &wordMeas
urement.fallbackFonts, textLayout); | 2633 additionalTmpW = textWidth(t, lastSpace, current.m_pos -
lastSpace, f, width.currentWidth(), isFixedPitch, collapseWhiteSpace, &wordMeas
urement.fallbackFonts, textLayout); |
2634 | 2634 |
2635 wordMeasurement.width = additionalTmpW + wordSpacingForWordM
easurement; | 2635 wordMeasurement.width = additionalTmpW + wordSpacingForWordM
easurement; |
2636 additionalTmpW += lastSpaceWordSpacing; | 2636 additionalTmpW += lastSpaceWordSpacing; |
2637 width.addUncommittedWidth(additionalTmpW); | 2637 width.addUncommittedWidth(additionalTmpW); |
2638 if (!appliedStartWidth) { | 2638 if (!appliedStartWidth) { |
2639 width.addUncommittedWidth(inlineLogicalWidth(current.m_o
bj, true, false)); | 2639 width.addUncommittedWidth(inlineLogicalWidth(current.m_o
bj, true, false)); |
2640 appliedStartWidth = true; | 2640 appliedStartWidth = true; |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3086 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver
ticalPositionCache); | 3086 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver
ticalPositionCache); |
3087 | 3087 |
3088 setLineGridBox(lineGridBox); | 3088 setLineGridBox(lineGridBox); |
3089 | 3089 |
3090 // FIXME: If any of the characteristics of the box change compared to the ol
d one, then we need to do a deep dirtying | 3090 // FIXME: If any of the characteristics of the box change compared to the ol
d one, then we need to do a deep dirtying |
3091 // (similar to what happens when the page height changes). Ideally, though,
we only do this if someone is actually snapping | 3091 // (similar to what happens when the page height changes). Ideally, though,
we only do this if someone is actually snapping |
3092 // to this grid. | 3092 // to this grid. |
3093 } | 3093 } |
3094 | 3094 |
3095 } | 3095 } |
OLD | NEW |