User Guide

114 Chapter 5: Fireworks JavaScript API
dom.addNewRectangle()
Availability
Fireworks 3.
Usage
dom.addNewRectangle(boundingRectangle, roundness)
Arguments
boundingRectangle
A rectangle that specifies the bounds within which the new rectangle is
added (see “Rectangle data type” on page 11).
roundness A floating-point value between 0 and 1 that specifies the “roundness” to use for the
corners (0 is no roundness, 1 is 100% roundness).
Returns
Nothing.
Description
Adds a new rectangle or rounded rectangle fitting into the specified bounds. The rectangle uses
the document’s current default path attributes and is added on the current frame and layer.
Example
The following command adds a new rectangle with no round corners within the
specified coordinates.
fw.getDocumentDOM().addNewRectangle({left:0, top:0, right:100, bottom:100},
0);
See also
dom.addNewRectanglePrimitive()
dom.addNewRectanglePrimitive()
Availability
Fireworks 4.
Usage
dom.addNewRectanglePrimitive(boundingRectangle, roundness)
Arguments
boundingRectangle
A rectangle that specifies the bounds within which the new rectangle
primitive is added (see “Rectangle data type” on page 11).
roundness A floating-point value between 0 and 1 that specifies the “roundness” to use for the
corners (0 is no roundness, and 1 is 100% roundness).
Returns
Nothing.