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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 textBox->setExpansion(expansion); | 523 textBox->setExpansion(expansion); |
524 totalLogicalWidth += expansion; | 524 totalLogicalWidth += expansion; |
525 } | 525 } |
526 expansionOpportunityCount -= opportunitiesInRun; | 526 expansionOpportunityCount -= opportunitiesInRun; |
527 if (!expansionOpportunityCount) | 527 if (!expansionOpportunityCount) |
528 break; | 528 break; |
529 } | 529 } |
530 } | 530 } |
531 } | 531 } |
532 | 532 |
533 void RenderBlockFlow::updateLogicalWidthForAlignment(const ETextAlign& textAlign
, const RootInlineBox* rootInlineBox, BidiRun* trailingSpaceRun, float& logicalL
eft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpport
unityCount) | 533 void RenderBlockFlow::updateLogicalWidthForAlignment(const ETextAlign& textAlign
, const RootInlineBox* rootInlineBox, BidiRun* trailingSpaceRun, float& logicalL
eft, float& totalLogicalWidth, float& availableLogicalWidth, unsigned expansionO
pportunityCount) |
534 { | 534 { |
535 TextDirection direction; | 535 TextDirection direction; |
536 if (rootInlineBox && rootInlineBox->renderer().style()->unicodeBidi() == Pla
intext) | 536 if (rootInlineBox && rootInlineBox->renderer().style()->unicodeBidi() == Pla
intext) |
537 direction = rootInlineBox->direction(); | 537 direction = rootInlineBox->direction(); |
538 else | 538 else |
539 direction = style()->direction(); | 539 direction = style()->direction(); |
540 | 540 |
541 // Armed with the total width of the line (without justification), | 541 // Armed with the total width of the line (without justification), |
542 // we now examine our text-align property in order to determine where to pos
ition the | 542 // we now examine our text-align property in order to determine where to pos
ition the |
543 // objects horizontally. The total width of the line can be increased if we
end up | 543 // objects horizontally. The total width of the line can be increased if we
end up |
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2193 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat
(); | 2193 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat
(); |
2194 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal
se) - logicalLeft; | 2194 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal
se) - logicalLeft; |
2195 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); | 2195 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); |
2196 | 2196 |
2197 if (!style()->isLeftToRightDirection()) | 2197 if (!style()->isLeftToRightDirection()) |
2198 return logicalWidth() - logicalLeft; | 2198 return logicalWidth() - logicalLeft; |
2199 return logicalLeft; | 2199 return logicalLeft; |
2200 } | 2200 } |
2201 | 2201 |
2202 } | 2202 } |
OLD | NEW |