A Rectangle specifies an area that is enclosed by it's top-left point (x, y), its width, and its height. It should not be confused with a rectangular path, it is not an art object.
Constructors
Creates a new Rectangle.
Parameters:
x: Number - The left coordinate.
y: Number - The top coordinate.
width: Number
height: Number
Creates a new rectangle from the passed rectangle.
Parameters:
rt: Rectangle
Parameters:
rt: Rectangle
Creates a new rectangle from the passed object literal.
Sample code:
Sample code:
var rect = new Rectangle({x:10,
y:10,
width:320,
height:240});
Parameters:
map: Object - {x, y, width, height}
Properties
The bottom coordinate of the rectangle. In the AI coordinatesystem, the y axis grows from bottom to top. Note that this doesn't movethe whole rectangle: the top won't move.
Returns:
Number
Returns:
Returns:
Read-only.Returns true if the rectangle is empty,
false otherwise.
Returns:
Boolean
The height of the rectangle.
Returns:
Number
The position of the left hand side of the rectangle. Note that thisdoesn't move the whole rectangle; the right hand side stays where it was.
Returns:
Number
The position of the right hand side of the rectangle. Note that thisdoesn't move the whole rectangle; the left hand side stays where it was.
Returns:
Number
The top coordinate of the rectangle. In the AI coordinatesystem, the y axis grows from bottom to top. Note that thisdoesn't move the whole rectangle: the bottom won't move.
Returns:
Number
The width of the rectangle.
Returns:
Number
The x position of the rectangle.
Returns:
Number
The y position of the rectangle. In the AI coordinatesystem, the y axis grows from bottom to top.
Returns:
Number
Functions
Clones the rectangle.
Returns:
Object
Tests if specified coordinates are inside the boundary of the rectangle.
Parameters:
x: Number
y: Number
Returns:
Boolean
- true if the specified coordinates are inside the
boundary of the rectangle; false otherwise.
Tests if the specified point is inside the boundary of the rectangle.
Parameters:
p: Point - the specified point
Returns:
Boolean
- true if the point is inside the rectangle's
boundary; false otherwise.
Tests if the interior of the rectangle entirely contains the specified
rectangle.
Parameters:
rect: Rectangle - The specified rectangle
Returns:
Boolean
- true if the rectangle entirely contains the
specified rectangle; false otherwise.
Adds a point, specified by the double precision arguments px
and py, to the rectangle. The resulting rectangle is the
smallest rectangle that contains both the original rectangle and the
specified point.
After adding a point, a call to contains with the added point as an argument does not necessarily return true.
The contains method does not return true for points on the right or bottom edges of a rectangle. Therefore, if the added point falls on the left or bottom edge of the enlarged rectangle, contains returns false for that point.
After adding a point, a call to contains with the added point as an argument does not necessarily return true.
The contains method does not return true for points on the right or bottom edges of a rectangle. Therefore, if the added point falls on the left or bottom edge of the enlarged rectangle, contains returns false for that point.
Parameters:
px: Number
py: Number
Adds a point to this rectangle. The resulting rectangle is the
smallest rectangle that contains both the original rectangle and the
specified point.
After adding a point, a call to contains with the added point as an argument does not necessarily return true.
The contains method does not return true for points on the right or bottom edges of a rectangle. Therefore, if the added point falls on the left or bottom edge of the enlarged rectangle, contains returns false for that point.
After adding a point, a call to contains with the added point as an argument does not necessarily return true.
The contains method does not return true for points on the right or bottom edges of a rectangle. Therefore, if the added point falls on the left or bottom edge of the enlarged rectangle, contains returns false for that point.
Parameters:
pt: Point
Adds a rectangle to this rectangle. The resulting rectangle is the union
of the two rectangles.
Parameters:
rect: Rectangle - the rectangle to add to this rectangle.
Tests if the interior of this rectangle intersects the interior of
another rectangle.
Parameters:
r: Rectangle - the specified rectangle
Returns:
Boolean
- true if the rectangle and the specified rectangle
intersect each other; false otherwise.
Changes the boundary properties of the rectangle.
Parameters:
x: Number - The left position.
y: Number - The top position.
width: Number
height: Number
-

SG
-

AI- Point
- Rectangle
- Color
- Matrix
- Art
- Segment
- SegmentList
- Curve
- CurveList
- TextRange
- TextStory
- PathStyle
- FillStyle
- StrokeStyle
- ParagraphStyle
- FontFamily
- FontWeight
- FontList
- ArtSet
- Pathfinder
- HitTest
- Document
- DocumentList
- LayerList
- Swatch
- SwatchList
- Gradient
- GradientList
- GradientStop
- GradientStopList
- Symbol
- SymbolList
- Pattern
- PatternList
- Timer
- LiveEffect
- Annotator
- DocumentView
- DocumentViewList
-

ADM