|
| BRect () |
| Creates an empty BRect object with dimensions (0, 0, -1, -1).
|
|
| BRect (BPoint leftTop, BPoint rightBottom) |
| Creates a new BRect object with its dimensions defined by the leftTop and rightBottom points.
|
|
| BRect (BPoint leftTop, BSize size) |
| Creates a new BRect object with its dimensions defined by the leftTop point and size.
|
|
| BRect (const BRect &other) |
| Creates a new BRect object as a copy of other.
|
|
| BRect (float left, float top, float right, float bottom) |
| Creates a new BRect object with the given dimensions.
|
|
| BRect (float side) |
| Creates a new BRect object setting the left and top dimensions to 0 and setting the right and bottom dimensions to side - 1.
|
|
bool | Contains (BPoint point) const |
| Returns whether or not the BRect contains point.
|
|
bool | Contains (BRect rect) const |
| Returns whether or not the BRect wholly contains rect.
|
|
float | Height () const |
| Returns the height of the rectangle.
|
|
int32 | IntegerHeight () const |
| Returns The height of the rectangle rounded using ceil(bottom - top).
|
|
int32 | IntegerWidth () const |
| Returns The width of the rectangle rounded using ceil(right - left).
|
|
bool | Intersects (BRect rect) const |
| Returns whether or not the BRect and rect intersect.
|
|
bool | IsValid () const |
| Returns whether or not the BRect is valid.
|
|
BPoint | LeftBottom () const |
| Returns the left bottom point of the BRect.
|
|
BPoint | LeftTop () const |
| Returns the left top point of the BRect.
|
|
void | PrintToStream () const |
| Prints the BRect dimensions to standard output.
|
|
BPoint | RightBottom () const |
| Returns the right bottom point of the BRect.
|
|
BPoint | RightTop () const |
| Returns the right top point of the BRect.
|
|
void | Set (float left, float top, float right, float bottom) |
| Sets the dimensions of a BRect.
|
|
void | SetLeftBottom (const BPoint point) |
| Sets the left bottom point of the BRect.
|
|
void | SetLeftTop (const BPoint point) |
| Sets the left top point of the BRect.
|
|
void | SetRightBottom (const BPoint point) |
| Sets the right bottom point of the BRect.
|
|
void | SetRightTop (const BPoint point) |
| Sets the right top point of the BRect.
|
|
BSize | Size () const |
| Returns the dimensions of the BRect.
|
|
float | Width () const |
| Returns the width of the rectangle.
|
|
|
BRect & | operator= (const BRect &other) |
| Creates a new BRect object as a copy of other by overloading the = operator.
|
|
bool | operator== (BRect other) const |
| Returns whether or not two rectangles coincide exactly.
|
|
bool | operator!= (BRect other) const |
| Returns whether or not two rectangles do NOT coincide exactly.
|
|
BRect | operator& (BRect other) const |
| Creates and returns a new BRect that is the intersection of the BRect and other.
|
|
BRect | operator| (BRect other) const |
| Returns a new BRect that is the union of the BRect and other.
|
|
|
Positive values make the rectangle smaller, negative values make it larger.
The …Self() versions also return the transformed BRect when they are done. The …Copy() versions transform a copy without changing the original.
|
void | InsetBy (BPoint inset) |
| Inset the BRect by the x and y coordinates of point.
|
|
void | InsetBy (float dx, float dy) |
| Inset the BRect by dx units in the horizontal direction and dy units in the vertical direction.
|
|
BRect & | InsetBySelf (BPoint inset) |
| Like BRect::InsetBy() but returns the transformed BRect.
|
|
BRect & | InsetBySelf (float dx, float dy) |
| Like BRect::InsetBy() but returns the transformed BRect.
|
|
BRect | InsetByCopy (BPoint inset) const |
| Like BRect::InsetBy() but returns a copy of the transformed BRect leaving the original unmodified.
|
|
BRect | InsetByCopy (float dx, float dy) const |
| Like BRect::InsetBy() but returns a copy of the transformed BRect leaving the original unmodified.
|
|
|
Positive values move the rectangle right and down, negative values move the rectangle left and up.
The …Self() versions also return the translated BRect when they are done. The …Copy() versions translate a copy without changing the original.
|
void | OffsetBy (BPoint delta) |
| Moves the BRect horizontally by the x value of point and vertically by y value of point without changing the size of the rectangle.
|
|
void | OffsetBy (float dx, float dy) |
| Moves the BRect horizontally by dx units and vertically by dy units point without changing the size of the rectangle.
|
|
void | OffsetTo (BPoint offset) |
| Move the BRect to the location specified by point.
|
|
void | OffsetTo (float x, float y) |
| Move the BRect to the point specified by the given x and y coordinates.
|
|
BRect & | OffsetBySelf (BPoint offset) |
| Like BRect::OffsetBy() but returns the translated BRect.
|
|
BRect & | OffsetBySelf (float dx, float dy) |
| Like BRect::OffsetBy() but returns the translated BRect.
|
|
BRect | OffsetByCopy (BPoint offset) const |
| Like BRect::OffsetBy() but returns a copy of the translated BRect leaving the original unmodified.
|
|
BRect | OffsetByCopy (float dx, float dy) const |
| Like BRect::OffsetBy() but returns a copy of the translated BRect leaving the original unmodified.
|
|
BRect & | OffsetToSelf (BPoint offset) |
| Like BRect::OffsetTo() but returns the translated BRect.
|
|
BRect & | OffsetToSelf (float x, float y) |
| Like BRect::OffsetTo() but returns the translated BRect.
|
|
BRect | OffsetToCopy (BPoint offset) const |
| Like BRect::OffsetTo() but returns a copy of the translated BRect leaving the original unmodified.
|
|
BRect | OffsetToCopy (float x, float y) const |
| Like BRect::OffsetTo() but returns a copy of the translated BRect leaving the original unmodified.
|
|
Defines a rectangular area aligned along pixel dimensions.
BRect's are used throughout the Interface Kit to define the frames of windows, views, and bitmaps. BRect's are always oriented with completely vertical and horizontal lines, they cannot be rotated.
A BRect must have a non-negative width and height to be valid, that is the left value must be greater than or equal to the right value and the bottom edge value be greater than or equal to the top value. You can test whether or not a BRect is valid by calling IsValid(). Nothing prevents you from creating an invalid BRect, but, using one to define an area can produce unpredictable results.
A gotcha of using BRect's is that the starting point is 0, not 1, so in order to create a BRect with a 32x32 pixel area you write:
BRect()
Creates an empty BRect object with dimensions (0, 0, -1, -1).
Definition: Rect.h:121
or if you have the width and height stored in a variable you subtract 1 like this:
BRect(0, 0, width - 1, height -1);
- Since
- BeOS R3