class 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 GskRoundedRect as an argument will internally operate on a normalized copy; all functions returning a GskRoundedRect will always return a normalized one.

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

Defined in:

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(bounds : Graphene::Rect? = nil, corner : Enumerable(Graphene::Size)? = nil) #

Instance Method Detail

def ==(other : self) : Bool #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def bounds : Graphene::Rect #

def bounds=(value : Graphene::Rect) #

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

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

def corner : Enumerable(Graphene::Size) #

def corner=(value : Enumerable(Graphene::Size)) #

def finalize #

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 #

def to_unsafe : Pointer(Void) #