RECTANGLE ​
Draws a rectangle.
Syntax ​
leo-grammar
RECTANGLE [ x:measureValue ] [ y:measureValue ] [ w:measureValue ] [ h:measureValue ] .
Parameters ​
x
(measureValue, optional) - The x-coordinate of the top-left corner of the rectangle. The default is0cm
.y
(measureValue, optional) - The y-coordinate of the top-left corner of the rectangle. The default is0cm
.w
(measureValue, optional) - The width of the rectangle. The default is0cm
.h
(measureValue, optional) - The height of the rectangle. The default is0cm
.
Details ​
The style of this command is defined by the PEN
command for the outline and the FILL
command to fill the shape.
The left and the right side of the rectangle are always parallel to the y-axis, the other two sides thus parallel to the x-axis.
Rotation of a rectangle is not possible. This has an influence on the drawing of relations where a rectangle's shape will change with different rotations. If a rotation of the rectangle is necessary then use a POLYGON
instead.
See Also ​
Examples ​
Draw a 3cm wide and 2cm tall rectangle centered on the middle position (0cm
, 0cm
).
leo
GRAPHREP
SHADOW off
RECTANGLE x:-1.5cm y:-1cm w:3cm h:2cm
Draw a small green square with an orange border.
leo
GRAPHREP
SHADOW off
PEN color:"orange" w:2pt
FILL color:"green"
RECTANGLE w:1cm h:1cm
Versions and Changes ​
Available since ADOxx 1.3