Class: Layout::Rectangle
Overview
A simple rectangular shape entity.
Constant Summary #
- Layout::Rectangle::TYPE_NORMAL
- Layout::Rectangle::TYPE_ROUNDED
- Layout::Rectangle::TYPE_LOZENGE
- Layout::Rectangle::TYPE_BULGED
Instance Method Summary # collapse
-
#initialize(*args) ⇒ Object
constructor
The #initialize method creates a new normal, lozenge, bulged or rounded Rectangle, depending on the type passed in.
- #radius ⇒ Float?
- #radius=(radius) ⇒ Object
- #type ⇒ Integer
- #type=(type) ⇒ Object
Methods inherited from Entity
#==, #bounds, #document, #drawing_bounds, #group, #layer_instance, #locked=, #locked?, #move_to_group, #move_to_layer, #on_shared_layer?, #page, #style, #style=, #transform!, #transformation, #untransformed_bounds, #untransformed_bounds=
Constructor Details
↑ #initialize(bounds) ⇒ Layout::Rectangle #initialize(bounds, type) ⇒ Layout::Rectangle #initialize(bounds, type, radius) ⇒ Layout::Rectangle
The #initialize method creates a new normal, lozenge, bulged or rounded Layout::Rectangle, depending on the type passed in.
The rectangle type can be one of the following values:
Layout::Rectangle::TYPE_NORMAL
Layout::Rectangle::TYPE_ROUNDED
Layout::Rectangle::TYPE_LOZENGE
Layout::Rectangle::TYPE_BULGED
Instance Method Details
↑ #radius ⇒ Float?
The #radius method returns the radius of the Layout::Rectangle, or nil
if the Layout::Rectangle is not of type Layout::Rectangle::TYPE_BULGED
or Layout::Rectangle::TYPE_ROUNDED
↑ #radius=(radius) ⇒ Object
The #radius= method sets the radius of the Layout::Rectangle.
↑ #type ⇒ Integer
The #type method returns the type of the Layout::Rectangle.
The type of a rectangle can be one of the following:
Layout::Rectangle::TYPE_NORMAL
Layout::Rectangle::TYPE_ROUNDED
Layout::Rectangle::TYPE_LOZENGE
Layout::Rectangle::TYPE_BULGED
↑ #type=(type) ⇒ Object
The #type= method sets the type of the Layout::Rectangle. If the type is set to Layout::Rectangle::TYPE_ROUNDED
or Layout::Rectangle::TYPE_BULGED
, the [Layout::Rectangle]'s radius will be set to the default value of 0.25, if the value had not previously been set.
The type of a Layout::Rectangle can be one of the following:
Layout::Rectangle::TYPE_NORMAL
Layout::Rectangle::TYPE_ROUNDED
Layout::Rectangle::TYPE_LOZENGE
Layout::Rectangle::TYPE_BULGED