AdjustBounds
protoDrawTool:AdjustBounds
(shape, style, left, top, right, bottom, constrain)
Called to limit the bounds of the object as the user is dragging out a new bounding box or resizing an existing object.
DISCUSSION
- shape
- Either a graphic object, or
nil
if a new object is being created anddragARectangle
is set totrue
.
- style
- The current user defaults for
penSize
,penPattern
,fillPattern
, andfont
.
- left
- The x-coordinate of the start point of the rectangle the user dragged with this tool.
- top
- The y-coordinate of the start point of the rectangle the user dragged with this tool.
- right
- The x-coordinate of the end point of the rectangle the user dragged with this tool.
- bottom
- The y-coordinate of the start point of the rectangle the user dragged with this tool.
- constrain
- The value
true
indicates that the shift key is pressed.
- return value
- A bounds frame.
The default version of this method limits the bounding box to always be square when constrain is
true
. If you override this method, you should do something similar.SPECIAL CONSIDERATIONS
If the user drags up and to the left, the values passed as the right and bottom arguments can be less than those passed as the left and top arguments. The
left
slot in bounds frame you return should beMin(left, right)
, thetop
slot should beMin(top, bottom)
, and so on.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help