| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2009 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 bool isEmpty() const { return m_size.isEmpty(); } | 86 bool isEmpty() const { return m_size.isEmpty(); } |
| 87 | 87 |
| 88 // NOTE: The result is rounded to integer values, and thus may be not the ex
act | 88 // NOTE: The result is rounded to integer values, and thus may be not the ex
act |
| 89 // center point. | 89 // center point. |
| 90 IntPoint center() const { return IntPoint(x() + width() / 2, y() + height()
/ 2); } | 90 IntPoint center() const { return IntPoint(x() + width() / 2, y() + height()
/ 2); } |
| 91 | 91 |
| 92 void move(const IntSize& size) { m_location += size; } | 92 void move(const IntSize& size) { m_location += size; } |
| 93 void moveBy(const IntPoint& offset) { m_location.move(offset.x(), offset.y()
); } | 93 void moveBy(const IntPoint& offset) { m_location.move(offset.x(), offset.y()
); } |
| 94 void move(int dx, int dy) { m_location.move(dx, dy); } | 94 void move(int dx, int dy) { m_location.move(dx, dy); } |
| 95 void saturatedMove(int dx, int dy) { m_location.saturatedMove(dx, dy); } |
| 95 | 96 |
| 96 void expand(const IntSize& size) { m_size += size; } | 97 void expand(const IntSize& size) { m_size += size; } |
| 97 void expand(int dw, int dh) { m_size.expand(dw, dh); } | 98 void expand(int dw, int dh) { m_size.expand(dw, dh); } |
| 98 void expand(const IntRectOutsets& outsets) | 99 void expand(const IntRectOutsets& outsets) |
| 99 { | 100 { |
| 100 m_location.move(-outsets.left(), -outsets.top()); | 101 m_location.move(-outsets.left(), -outsets.top()); |
| 101 m_size.expand(outsets.left() + outsets.right(), outsets.top() + outsets.
bottom()); | 102 m_size.expand(outsets.left() + outsets.right(), outsets.top() + outsets.
bottom()); |
| 102 } | 103 } |
| 103 | 104 |
| 104 void contract(const IntSize& size) { m_size -= size; } | 105 void contract(const IntSize& size) { m_size -= size; } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 235 |
| 235 // Redeclared here to avoid ODR issues. | 236 // Redeclared here to avoid ODR issues. |
| 236 // See platform/testing/GeometryPrinters.h. | 237 // See platform/testing/GeometryPrinters.h. |
| 237 void PrintTo(const IntRect&, std::ostream*); | 238 void PrintTo(const IntRect&, std::ostream*); |
| 238 | 239 |
| 239 } // namespace blink | 240 } // namespace blink |
| 240 | 241 |
| 241 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::IntRect); | 242 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::IntRect); |
| 242 | 243 |
| 243 #endif // IntRect_h | 244 #endif // IntRect_h |
| OLD | NEW |