struct Graphene::Rect
- Graphene::Rect
- Struct
- Value
- Object
Overview
The location and size of a rectangle region.
The width and height of a #graphene_::rect_t can be negative; for instance, a #graphene_::rect_t with an origin of [ 0, 0 ] and a size of [ 10, 10 ] is equivalent to a #graphene_::rect_t with an origin of [ 10, 10 ] and a size of [ -10, -10 ].
Application code can normalize rectangles using graphene_::rect_normalize(); this function will ensure that the width and height of a rectangle are positive values. All functions taking a #graphene_::rect_t as an argument will internally operate on a normalized copy; all functions returning a #graphene_::rect_t will always return a normalized rectangle.
Defined in:
lib/gi-crystal/src/auto/graphene-1.0/rect.crConstructors
- .new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
- .new(data : LibGraphene::Rect, _transfer : GICrystal::Transfer)
- .new(origin : Graphene::Point | Nil = nil, size : Graphene::Size | Nil = nil)
Class Method Summary
- .alloc : Graphene::Rect
-
.g_type : UInt64
Returns the type id (GType) registered in GLib type system.
- .zero : Graphene::Rect
Instance Method Summary
- #==(other : self) : Bool
- #area : Float32
- #bottom_left : Graphene::Point
- #bottom_right : Graphene::Point
- #center : Graphene::Point
- #contains_point(p : Graphene::Point) : Bool
- #contains_rect(b : Graphene::Rect) : Bool
- #equal(b : Graphene::Rect) : Bool
- #expand(p : Graphene::Point) : Graphene::Rect
- #free : Nil
- #height : Float32
- #init(x : Float32, y : Float32, width : Float32, height : Float32) : Graphene::Rect
- #init_from_rect(src : Graphene::Rect) : Graphene::Rect
- #inset(d_x : Float32, d_y : Float32) : Graphene::Rect
- #inset_r(d_x : Float32, d_y : Float32) : Graphene::Rect
- #interpolate(b : Graphene::Rect, factor : Float64) : Graphene::Rect
- #intersection(b : Graphene::Rect) : Graphene::Rect
- #normalize : Graphene::Rect
- #normalize_r : Graphene::Rect
- #offset(d_x : Float32, d_y : Float32) : Graphene::Rect
- #offset_r(d_x : Float32, d_y : Float32) : Graphene::Rect
- #origin(*args, **options)
- #origin(*args, **options, &)
- #origin=(arg)
-
#round : Graphene::Rect
DEPRECATED
- #round_extents : Graphene::Rect
-
#round_to_pixel : Graphene::Rect
DEPRECATED
- #scale(s_h : Float32, s_v : Float32) : Graphene::Rect
- #size(*args, **options)
- #size(*args, **options, &)
- #size=(arg)
- #top_left : Graphene::Point
- #top_right : Graphene::Point
- #union(b : Graphene::Rect) : Graphene::Rect
- #vertices(vertices : Enumerable(Graphene::Vec2)) : Nil
- #vertices(*vertices : Graphene::Vec2)
- #width : Float32
- #x : Float32
- #y : Float32
Constructor Detail
Class Method Detail
Returns the type id (GType) registered in GLib type system.