| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 startOverhang = std::min<int>(startOverhang, m_committedWidth); | 113 startOverhang = std::min<int>(startOverhang, m_committedWidth); |
| 114 m_availableWidth += startOverhang; | 114 m_availableWidth += startOverhang; |
| 115 | 115 |
| 116 endOverhang = std::max(std::min<int>(endOverhang, m_availableWidth - current
Width()), 0); | 116 endOverhang = std::max(std::min<int>(endOverhang, m_availableWidth - current
Width()), 0); |
| 117 m_availableWidth += endOverhang; | 117 m_availableWidth += endOverhang; |
| 118 m_overhangWidth += startOverhang + endOverhang; | 118 m_overhangWidth += startOverhang + endOverhang; |
| 119 } | 119 } |
| 120 | 120 |
| 121 inline static float availableWidthAtOffset(LineLayoutBlockFlow block, const Layo
utUnit& offset, IndentTextOrNot indentText, float& newLineLeft, | 121 inline static float availableWidthAtOffset(LineLayoutBlockFlow block, const Layo
utUnit& offset, IndentTextOrNot indentText, float& newLineLeft, |
| 122 float& newLineRight, const LayoutUnit& lineHeight = 0) | 122 float& newLineRight, const LayoutUnit& lineHeight = LayoutUnit()) |
| 123 { | 123 { |
| 124 newLineLeft = block.logicalLeftOffsetForLine(offset, indentText, lineHeight)
.toFloat(); | 124 newLineLeft = block.logicalLeftOffsetForLine(offset, indentText, lineHeight)
.toFloat(); |
| 125 newLineRight = block.logicalRightOffsetForLine(offset, indentText, lineHeigh
t).toFloat(); | 125 newLineRight = block.logicalRightOffsetForLine(offset, indentText, lineHeigh
t).toFloat(); |
| 126 return std::max(0.0f, newLineRight - newLineLeft); | 126 return std::max(0.0f, newLineRight - newLineLeft); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void LineWidth::updateLineDimension(LayoutUnit newLineTop, LayoutUnit newLineWid
th, const float& newLineLeft, const float& newLineRight) | 129 void LineWidth::updateLineDimension(LayoutUnit newLineTop, LayoutUnit newLineWid
th, const float& newLineLeft, const float& newLineRight) |
| 130 { | 130 { |
| 131 if (newLineWidth <= m_availableWidth) | 131 if (newLineWidth <= m_availableWidth) |
| 132 return; | 132 return; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 189 } |
| 190 updateLineDimension(lastFloatLogicalBottom, newLineWidth, newLineLeft, newLi
neRight); | 190 updateLineDimension(lastFloatLogicalBottom, newLineWidth, newLineLeft, newLi
neRight); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void LineWidth::computeAvailableWidthFromLeftAndRight() | 193 void LineWidth::computeAvailableWidthFromLeftAndRight() |
| 194 { | 194 { |
| 195 m_availableWidth = max(0.0f, m_right - m_left) + m_overhangWidth; | 195 m_availableWidth = max(0.0f, m_right - m_left) + m_overhangWidth; |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace blink | 198 } // namespace blink |
| OLD | NEW |