RECTANGLE is a drawing tool capable of drawing filled rectangles and/or rectangle outlines. The corners of the rectangles may be rounded and the rectangles can be rotated.
A new rectangle is created by dragging with mouse from one of its corners to the opposite one.
After the mouse button is released, control handles appear and it is possible to further modify the shape, color, and other properties of the rectangle. If arbitrary coordinates mode is enabled, the rectangle can be rotated by arbitrary angle by dragging the extra control handle. In integral coordinates mode, rectangle can only by rotated by multiplies of 90 degrees.
Definition is finished by explicitly confirming the action (-> Apply button, Enter key, mouse gesture), by switching tool, by running certain commands (for example Save) or by starting a new rectangle.
Rectangle respects the current shape-fill mode: it is capable of drawing filled shape, shape outline or combination thereof. The outline if drawn with primary color, while the interior uses the active fill style.
The rectangle can have rounded corners. Corner radius is set in the tool properties panel. It is also possible to switch to square mode that forces the height and width of the rectangle to be the same.
After the initial definition (while control handles are visible), it is possible to adjust position and size of the rectangle using keyboard. Arrow keys move the rectangle. Holding SHIFT key and using arrow keys resizes the rectangle.
Rectangle can be successfully combined with many meta-tools (select, stylize, eraser) to achieve various effects.
The left rectangle uses 10 pixels corner radius, 5 pixels outline width and outline shape-fill mode is enabled. The middle rectangle is filled by predefined pattern. The right rectangle uses generated clouds texture and the stylize meta-tool to add a shadow and blur background behind the rectangle.
RECTANGLE tool can be used from scripts. The command in script may have 4 to 6 parameters:
DrawTool.RECTANGLE(Document, 0, 100, 100, 50, 30);
See also: DrawTool object, Document object