OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003-2016 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003-2016 Apple Inc. All rights reserved. |
3 * Copyright (C) 2005 Nokia. All rights reserved. | 3 * Copyright (C) 2005 Nokia. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 void setLocation(const FloatPoint& location) { m_location = location; } | 82 void setLocation(const FloatPoint& location) { m_location = location; } |
83 void setSize(const FloatSize& size) { m_size = size; } | 83 void setSize(const FloatSize& size) { m_size = size; } |
84 | 84 |
85 float x() const { return m_location.x(); } | 85 float x() const { return m_location.x(); } |
86 float y() const { return m_location.y(); } | 86 float y() const { return m_location.y(); } |
87 float maxX() const { return x() + width(); } | 87 float maxX() const { return x() + width(); } |
88 float maxY() const { return y() + height(); } | 88 float maxY() const { return y() + height(); } |
89 float width() const { return m_size.width(); } | 89 float width() const { return m_size.width(); } |
90 float height() const { return m_size.height(); } | 90 float height() const { return m_size.height(); } |
91 | 91 |
| 92 float area() const { return m_size.area(); } |
| 93 |
92 void setX(float x) { m_location.setX(x); } | 94 void setX(float x) { m_location.setX(x); } |
93 void setY(float y) { m_location.setY(y); } | 95 void setY(float y) { m_location.setY(y); } |
94 void setWidth(float width) { m_size.setWidth(width); } | 96 void setWidth(float width) { m_size.setWidth(width); } |
95 void setHeight(float height) { m_size.setHeight(height); } | 97 void setHeight(float height) { m_size.setHeight(height); } |
96 | 98 |
97 bool isEmpty() const { return m_size.isEmpty(); } | 99 bool isEmpty() const { return m_size.isEmpty(); } |
98 bool isZero() const { return m_size.isZero(); } | 100 bool isZero() const { return m_size.isZero(); } |
99 bool isExpressibleAsIntRect() const; | 101 bool isExpressibleAsIntRect() const; |
100 | 102 |
101 FloatPoint center() const { return location() + size() / 2; } | 103 FloatPoint center() const { return location() + size() / 2; } |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 265 } |
264 | 266 |
265 WEBCORE_EXPORT FloatRect encloseRectToDevicePixels(const FloatRect&, float devic
eScaleFactor); | 267 WEBCORE_EXPORT FloatRect encloseRectToDevicePixels(const FloatRect&, float devic
eScaleFactor); |
266 WEBCORE_EXPORT IntRect enclosingIntRect(const FloatRect&); | 268 WEBCORE_EXPORT IntRect enclosingIntRect(const FloatRect&); |
267 WEBCORE_EXPORT IntRect roundedIntRect(const FloatRect&); | 269 WEBCORE_EXPORT IntRect roundedIntRect(const FloatRect&); |
268 | 270 |
269 WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, const FloatRect&); | 271 WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, const FloatRect&); |
270 | 272 |
271 } | 273 } |
272 | 274 |
OLD | NEW |