| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012, Google Inc. All rights reserved. | 2 * Copyright (c) 2012, Google Inc. 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 namespace blink { | 42 namespace blink { |
| 43 | 43 |
| 44 // Specifies LayoutUnit lengths to be used to expand a rectangle. | 44 // Specifies LayoutUnit lengths to be used to expand a rectangle. |
| 45 // For example, |top()| returns the distance the top edge should be moved | 45 // For example, |top()| returns the distance the top edge should be moved |
| 46 // upward. | 46 // upward. |
| 47 // | 47 // |
| 48 // Negative lengths can be used to express insets. | 48 // Negative lengths can be used to express insets. |
| 49 class PLATFORM_EXPORT LayoutRectOutsets { | 49 class PLATFORM_EXPORT LayoutRectOutsets { |
| 50 DISALLOW_NEW(); | 50 DISALLOW_NEW(); |
| 51 public: | 51 public: |
| 52 LayoutRectOutsets() : m_top(0), m_right(0), m_bottom(0), m_left(0) { } | 52 LayoutRectOutsets() { } |
| 53 LayoutRectOutsets(LayoutUnit top, LayoutUnit right, LayoutUnit bottom, Layou
tUnit left) | 53 LayoutRectOutsets(LayoutUnit top, LayoutUnit right, LayoutUnit bottom, Layou
tUnit left) |
| 54 : m_top(top), m_right(right), m_bottom(bottom), m_left(left) { } | 54 : m_top(top), m_right(right), m_bottom(bottom), m_left(left) { } |
| 55 LayoutRectOutsets(int top, int right, int bottom, int left) |
| 56 : m_top(LayoutUnit(top)), m_right(LayoutUnit(right)), m_bottom(LayoutUni
t(bottom)), m_left(LayoutUnit(left)) { } |
| 55 | 57 |
| 56 LayoutRectOutsets(const IntRectOutsets& outsets) | 58 LayoutRectOutsets(const IntRectOutsets& outsets) |
| 57 : m_top(outsets.top()) | 59 : m_top(LayoutUnit(outsets.top())) |
| 58 , m_right(outsets.right()) | 60 , m_right(LayoutUnit(outsets.right())) |
| 59 , m_bottom(outsets.bottom()) | 61 , m_bottom(LayoutUnit(outsets.bottom())) |
| 60 , m_left(outsets.left()) | 62 , m_left(LayoutUnit(outsets.left())) |
| 61 { | 63 { |
| 62 } | 64 } |
| 63 | 65 |
| 64 LayoutRectOutsets(const FloatRectOutsets& outsets) | 66 LayoutRectOutsets(const FloatRectOutsets& outsets) |
| 65 : m_top(outsets.top()) | 67 : m_top(LayoutUnit(outsets.top())) |
| 66 , m_right(outsets.right()) | 68 , m_right(LayoutUnit(outsets.right())) |
| 67 , m_bottom(outsets.bottom()) | 69 , m_bottom(LayoutUnit(outsets.bottom())) |
| 68 , m_left(outsets.left()) | 70 , m_left(LayoutUnit(outsets.left())) |
| 69 { | 71 { |
| 70 } | 72 } |
| 71 | 73 |
| 72 LayoutUnit top() const { return m_top; } | 74 LayoutUnit top() const { return m_top; } |
| 73 LayoutUnit right() const { return m_right; } | 75 LayoutUnit right() const { return m_right; } |
| 74 LayoutUnit bottom() const { return m_bottom; } | 76 LayoutUnit bottom() const { return m_bottom; } |
| 75 LayoutUnit left() const { return m_left; } | 77 LayoutUnit left() const { return m_left; } |
| 76 | 78 |
| 77 void setTop(LayoutUnit value) { m_top = value; } | 79 void setTop(LayoutUnit value) { m_top = value; } |
| 78 void setRight(LayoutUnit value) { m_right = value; } | 80 void setRight(LayoutUnit value) { m_right = value; } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 private: | 116 private: |
| 115 LayoutUnit m_top; | 117 LayoutUnit m_top; |
| 116 LayoutUnit m_right; | 118 LayoutUnit m_right; |
| 117 LayoutUnit m_bottom; | 119 LayoutUnit m_bottom; |
| 118 LayoutUnit m_left; | 120 LayoutUnit m_left; |
| 119 }; | 121 }; |
| 120 | 122 |
| 121 } // namespace blink | 123 } // namespace blink |
| 122 | 124 |
| 123 #endif // LayoutRectOutsets_h | 125 #endif // LayoutRectOutsets_h |
| OLD | NEW |