struct
Opal::UI::Rect
- Opal::UI::Rect
- Struct
- Value
- Object
Overview
A 2D integer bounding box for layouts, clipping, layers, and regions.
Defined in:
opal/ui/rect.crConstructors
- .new(x : Int32, y : Int32, width : Int32, height : Int32)
-
.new(width : Int32, height : Int32) : Rect
Convenience constructor for zero-origin rects
Instance Method Summary
- #bottom : Int32
-
#clamp_x(px : Int32) : Int32
Clamps an x-coordinate to lie within this rectangle.
-
#clamp_y(py : Int32) : Int32
Clamps a y-coordinate to lie within this rectangle.
- #contains?(px : Int32, py : Int32) : Bool
- #contains?(other : Rect) : Bool
- #height : Int32
- #in_bounds?(px : Int32, py : Int32) : Bool
-
#intersection(other : Rect) : Rect
Computes the intersection of this rect with another rect.
- #intersects?(other : Rect) : Bool
- #right : Int32
- #width : Int32
- #x : Int32
- #y : Int32
Constructor Detail
Convenience constructor for zero-origin rects
Instance Method Detail
Computes the intersection of this rect with another rect. If they do not intersect, returns a zero-sized rect.