Difference between revisions of "Recti"

From Silhouette Wiki
Jump to navigation Jump to search
Line 38: Line 38:
 
! scope="col" class="unsortable" | Description
 
! scope="col" class="unsortable" | Description
 
|-
 
|-
|Recti(left, top, width, height)
+
|Recti(left, top, right=-1, bottom=-1, width=-1, height=-1)
|Constructs a new Rectangle
+
|Constructs a new Rectangle. Use argument names to indicate right,bottom or width,height.
 
|-
 
|-
 
|clip(other)
 
|clip(other)

Revision as of 15:26, 23 June 2014

A Recti is a 2D integer rectangle, usually in pixel coordinates.

Attributes

Name Description
empty True if right=left and bottom=top (read-only)
left Left edge
top Top edge
right Right edge
bottom Bottom edge
width Rectangle width (right - left)
height Rectangle height (bottom - top)
valid True if the rectangle is valid (right>left, bottom>top) (read-only)

Methods

Name Description
Recti(left, top, right=-1, bottom=-1, width=-1, height=-1) Constructs a new Rectangle. Use argument names to indicate right,bottom or width,height.
clip(other) Returns a new Recti with this clipped to other