struct Gsk::RoundedRect

Overview

A rectangular region with rounded corners.

Application code should normalize rectangles using Gsk::RoundedRect#normalize; this function will ensure that the bounds of the rectangle are normalized and ensure that the corner values are positive and the corners do not overlap.

All functions taking a Gsk::RoundedRect as an argument will internally operate on a normalized copy; all functions returning a Gsk::RoundedRect will always return a normalized one.

The algorithm used for normalizing corner sizes is described in the CSS specification.

Defined in:

lib/gi-crystal/src/auto/gsk-4.0/rounded_rect.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pointer : Pointer(Void), transfer : GICrystal::Transfer) #

def self.new(data : LibGsk::RoundedRect, _transfer : GICrystal::Transfer) #

def self.new(bounds : Graphene::Rect? = nil, corner : Enumerable(Graphene::Size)? = nil) #

Instance Method Detail

def ==(other : self) : Bool #

def bounds(*args, **options) #

def bounds(*args, **options, &) #

def bounds=(arg) #

def contains_point(point : Graphene::Point) : Bool #

def contains_rect(rect : Graphene::Rect) : Bool #

def corner(*args, **options) #

def corner(*args, **options, &) #

def corner=(arg) #

def init(bounds : Graphene::Rect, top_left : Graphene::Size, top_right : Graphene::Size, bottom_right : Graphene::Size, bottom_left : Graphene::Size) : Gsk::RoundedRect #

def init_copy(src : Gsk::RoundedRect) : Gsk::RoundedRect #

def init_from_rect(bounds : Graphene::Rect, radius : Float32) : Gsk::RoundedRect #

def intersects_rect(rect : Graphene::Rect) : Bool #

def is_rectilinear : Bool #

def normalize : Gsk::RoundedRect #

def offset(dx : Float32, dy : Float32) : Gsk::RoundedRect #

def shrink(top : Float32, right : Float32, bottom : Float32, left : Float32) : Gsk::RoundedRect #