Difference between revisions of "Recti"

From Silhouette Wiki
Jump to navigation Jump to search
(Created page with "A Recti is a 2D integer rectangle, usually in pixel coordinates. === Attributes === {| class="wikitable" ! scope="col" | Name ! scope="col" class="unsortable" | Description ...")
 
Line 44: Line 44:
 
|Returns a new Recti with this clipped to other
 
|Returns a new Recti with this clipped to other
 
|-
 
|-
|moveTo(x, y)
 
|Moves the top left corner of the rectangle to x, y
 
|-
 
|set(x, y, width, height)
 
|Sets the rectangle position and size
 
|-
 
|setSize(width, height)
 
|Resizes the rectangle to the new width and height
 
|-
 
|translate(dx, dy)
 
|Translates the rectangle by dx and dy
 
|-
 
|translated(dx, dy)
 
|Returns a new Rect translated by dx and dy
 
 
|}
 
|}

Revision as of 15:25, 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, width, height) Constructs a new Rectangle
clip(other) Returns a new Recti with this clipped to other