|
| | Rect (ClutterRect* gobject, bool make_a_copy=true) |
| |
| | Rect (const Rect& other) |
| |
| Rect& | operator= (const Rect& other) |
| |
| | ~Rect () |
| |
| void | swap (Rect& other) |
| |
| ClutterRect* | gobj () |
| | Provides access to the underlying C instance. More...
|
| |
| const ClutterRect* | gobj () const |
| | Provides access to the underlying C instance. More...
|
| |
| ClutterRect* | gobj_copy () const |
| | Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs. More...
|
| |
| | Rect (float x=0, float y=0, float width=0, float height=0) |
| | Create a new Rect object, optionally specifying its dimensions. More...
|
| |
| Rect | normalise () |
| | Normalizes a Clutter::Rect. More...
|
| |
| Point | get_centre () const |
| | Retrieves the center of the rect and returns a rect with the correct coordinates. More...
|
| |
| bool | contains_point (const Point& point) const |
| | Checks whether point is contained by rect, after normalizing the rectangle. More...
|
| |
| bool | contains_rect (const Rect& b) const |
| | Checks whether a contains b. More...
|
| |
| Rect | rect_union (const Rect& b) const |
| | Computes the smallest possible rectangle capable of fully containing both this rect and b, and returns it. More...
|
| |
| bool | intersection (const Rect& b, Rect& res) const |
| | Computes the intersection of a and b, and places it in res, if res is not 0. More...
|
| |
| void | offset (float d_x, float d_y) |
| | Offsets the origin of rect by the given values, after normalizing the rectangle. More...
|
| |
| void | inset (float d_x, float d_y) |
| | Normalizes the rect and offsets its origin by the d_x and d_y values; the size is adjusted by (2 * d_x, 2 * d_y). More...
|
| |
| void | clamp_to_pixel () |
| | Rounds the origin of rect downwards to the nearest integer, and rounds the size of rect upwards to the nearest integer, so that rect is updated to the smallest rectangle capable of fully containing the original, fractional rectangle. More...
|
| |
| float | get_x () const |
| | Retrieves the X coordinate of the origin of rect. More...
|
| |
| float | get_y () const |
| | Retrieves the Y coordinate of the origin of rect. More...
|
| |
| float | get_width () const |
| | Retrieves the width of rect. More...
|
| |
| float | get_height () const |
| | Retrieves the height of rect. More...
|
| |
| void Clutter::Rect::inset |
( |
float |
d_x, |
|
|
float |
d_y |
|
) |
| |
Normalizes the rect and offsets its origin by the d_x and d_y values; the size is adjusted by (2 * d_x, 2 * d_y).
If d_x and d_y are positive the size of the rectangle is decreased; if the values are negative, the size of the rectangle is increased.
If the resulting rectangle has a negative width or height, the size is set to 0.
- Since cluttermm 1.12:
- Parameters
-
| d_x | An horizontal value; a positive d_x will create an inset rectangle, and a negative value will create a larger rectangle. |
| d_y | A vertical value; a positive d_x will create an inset rectangle, and a negative value will create a larger rectangle. |
| Rect Clutter::Rect::normalise |
( |
) | |
|
Normalizes a Clutter::Rect.
A Clutter::Rect is defined by the area covered by its size; this means that a Clutter::Rect with Clutter::Rect.origin in [ 0, 0 ] and a Clutter::Rect.size of [ 10, 10 ] is equivalent to a Clutter::Rect with Clutter::Rect.origin in [ 10, 10 ] and a Clutter::Rect.size of [ -10, -10 ].
This function is useful to ensure that a rectangle has positive width and height; it will modify the passed rect and normalize its size.
- Since cluttermm 1.12: