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 13 matching lines...) Expand all Loading... |
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
27 * OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * OF THE POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #include "sky/engine/config.h" | 30 #include "sky/engine/config.h" |
31 #include "sky/engine/core/rendering/line/LineWidth.h" | 31 #include "sky/engine/core/rendering/line/LineWidth.h" |
32 | 32 |
33 #include "sky/engine/core/rendering/RenderBlock.h" | 33 #include "sky/engine/core/rendering/RenderBlock.h" |
34 #include "sky/engine/core/rendering/RenderBlockFlow.h" | 34 #include "sky/engine/core/rendering/RenderParagraph.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 LineWidth::LineWidth(RenderBlockFlow& block, bool isFirstLine, IndentTextOrNot s
houldIndentText) | 38 LineWidth::LineWidth(RenderParagraph& block, bool isFirstLine, IndentTextOrNot s
houldIndentText) |
39 : m_block(block) | 39 : m_block(block) |
40 , m_uncommittedWidth(0) | 40 , m_uncommittedWidth(0) |
41 , m_committedWidth(0) | 41 , m_committedWidth(0) |
42 , m_trailingWhitespaceWidth(0) | 42 , m_trailingWhitespaceWidth(0) |
43 , m_left(0) | 43 , m_left(0) |
44 , m_right(0) | 44 , m_right(0) |
45 , m_availableWidth(0) | 45 , m_availableWidth(0) |
46 , m_shouldIndentText(shouldIndentText) | 46 , m_shouldIndentText(shouldIndentText) |
47 { | 47 { |
48 updateAvailableWidth(); | 48 updateAvailableWidth(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 100 } |
101 updateLineDimension(lastFloatLogicalBottom, newLineWidth, newLineLeft, newLi
neRight); | 101 updateLineDimension(lastFloatLogicalBottom, newLineWidth, newLineLeft, newLi
neRight); |
102 } | 102 } |
103 | 103 |
104 void LineWidth::computeAvailableWidthFromLeftAndRight() | 104 void LineWidth::computeAvailableWidthFromLeftAndRight() |
105 { | 105 { |
106 m_availableWidth = max(0.0f, m_right - m_left); | 106 m_availableWidth = max(0.0f, m_right - m_left); |
107 } | 107 } |
108 | 108 |
109 } | 109 } |
OLD | NEW |