pub type Allocation = Rectangle;
Aliased Type§
struct Allocation { /* private fields */ }
Implementations
Source§impl Rectangle
impl Rectangle
Sourcepub fn contains_point(&self, x: i32, y: i32) -> bool
pub fn contains_point(&self, x: i32, y: i32) -> bool
Sourcepub fn intersect(&self, src2: &Rectangle) -> Option<Rectangle>
pub fn intersect(&self, src2: &Rectangle) -> Option<Rectangle>
Calculates the intersection of two rectangles.
It is allowed for @dest to be the same as either @self or @src2.
If the rectangles do not intersect, @dest’s width and height is set
to 0 and its x and y values are undefined. If you are only interested
in whether the rectangles intersect, but not in the intersecting area
itself, pass None
for @dest.
§src2
§Returns
true
if the rectangles intersect.
§dest
return location for the intersection of @self and @src2
Sourcepub fn union(&self, src2: &Rectangle) -> Rectangle
pub fn union(&self, src2: &Rectangle) -> Rectangle
Calculates the union of two rectangles.
The union of rectangles @self and @src2 is the smallest rectangle which includes both @self and @src2 within it. It is allowed for @dest to be the same as either @self or @src2.
Note that this function does not ignore ‘empty’ rectangles (ie. with zero width or height).
§src2
§Returns
§dest
return location for the union of @self and @src2
Source§impl Rectangle
impl Rectangle
pub fn as_ptr(&self) -> *mut GdkRectangle
Sourcepub unsafe fn from_glib_ptr_borrow<'a>(
ptr: *const GdkRectangle,
) -> &'a Rectangle
pub unsafe fn from_glib_ptr_borrow<'a>( ptr: *const GdkRectangle, ) -> &'a Rectangle
Borrows the underlying C value.
Sourcepub unsafe fn from_glib_ptr_borrow_mut<'a>(
ptr: *mut GdkRectangle,
) -> &'a mut Rectangle
pub unsafe fn from_glib_ptr_borrow_mut<'a>( ptr: *mut GdkRectangle, ) -> &'a mut Rectangle
Borrows the underlying C value mutably.
Source§impl Rectangle
impl Rectangle
pub fn new(x: i32, y: i32, width: i32, height: i32) -> Rectangle
pub fn x(&self) -> i32
pub fn set_x(&mut self, x: i32)
pub fn y(&self) -> i32
pub fn set_y(&mut self, y: i32)
pub fn width(&self) -> i32
pub fn set_width(&mut self, width: i32)
pub fn height(&self) -> i32
pub fn set_height(&mut self, height: i32)
Trait Implementations
Source§impl AsRef<RectangleInt> for Rectangle
impl AsRef<RectangleInt> for Rectangle
Source§fn as_ref(&self) -> &RectangleInt
fn as_ref(&self) -> &RectangleInt
Source§impl From<RectangleInt> for Rectangle
impl From<RectangleInt> for Rectangle
Source§fn from(r: RectangleInt) -> Rectangle
fn from(r: RectangleInt) -> Rectangle
Source§impl HasParamSpec for Rectangle
impl HasParamSpec for Rectangle
Source§impl StaticType for Rectangle
impl StaticType for Rectangle
Source§fn static_type() -> Type
fn static_type() -> Type
Self
.