OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NGLogicalRect_h | 5 #ifndef NGLogicalRect_h |
6 #define NGLogicalRect_h | 6 #define NGLogicalRect_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/layout/ng/geometry/ng_logical_offset.h" | 9 #include "core/layout/ng/geometry/ng_logical_offset.h" |
10 #include "core/layout/ng/geometry/ng_logical_size.h" | 10 #include "core/layout/ng/geometry/ng_logical_size.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 LayoutUnit InlineStartOffset() const { return offset.inline_offset; } | 32 LayoutUnit InlineStartOffset() const { return offset.inline_offset; } |
33 LayoutUnit InlineEndOffset() const { | 33 LayoutUnit InlineEndOffset() const { |
34 return offset.inline_offset + size.inline_size; | 34 return offset.inline_offset + size.inline_size; |
35 } | 35 } |
36 LayoutUnit BlockStartOffset() const { return offset.block_offset; } | 36 LayoutUnit BlockStartOffset() const { return offset.block_offset; } |
37 LayoutUnit BlockEndOffset() const { | 37 LayoutUnit BlockEndOffset() const { |
38 return offset.block_offset + size.block_size; | 38 return offset.block_offset + size.block_size; |
39 } | 39 } |
40 | 40 |
| 41 NGLogicalOffset InlineEndBlockStartOffset() const { |
| 42 return {InlineEndOffset(), BlockStartOffset()}; |
| 43 } |
| 44 |
41 LayoutUnit BlockSize() const { return size.block_size; } | 45 LayoutUnit BlockSize() const { return size.block_size; } |
42 LayoutUnit InlineSize() const { return size.inline_size; } | 46 LayoutUnit InlineSize() const { return size.inline_size; } |
43 | 47 |
44 String ToString() const; | 48 String ToString() const; |
45 bool operator==(const NGLogicalRect& other) const; | 49 bool operator==(const NGLogicalRect& other) const; |
46 | 50 |
47 NGLogicalOffset offset; | 51 NGLogicalOffset offset; |
48 NGLogicalSize size; | 52 NGLogicalSize size; |
49 }; | 53 }; |
50 | 54 |
51 CORE_EXPORT std::ostream& operator<<(std::ostream&, const NGLogicalRect&); | 55 CORE_EXPORT std::ostream& operator<<(std::ostream&, const NGLogicalRect&); |
52 | 56 |
53 } // namespace blink | 57 } // namespace blink |
54 | 58 |
55 #endif // NGLogicalRect_h | 59 #endif // NGLogicalRect_h |
OLD | NEW |