Overview | File | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class draw2d.SnapToGrid

    Object
       |
       +--draw2d.SnapToHelper
             |
             +--draw2d.SnapToGrid

class draw2d.SnapToGrid
extends draw2d.SnapToHelper

Defined in SnapToGrid.js
Version: 0.9.14
Author: Andreas Herz

Fields inherited from class draw2d.SnapToHelper
`workflow`

Constructor Summary
`draw2d.SnapToGrid ( workflow)`

Method Summary
`Object` | `snapPoint( direction, inputPoint, resultPoint)` Applies a snapping correction to the given result.
`Object` | `snapRectangle( inputBounds, resultBounds)` Applies a snap correction to a Rectangle based on a given Rectangle.

Methods inherited from class draw2d.SnapToHelper
``

Constructor Detail

### draw2d.SnapToGrid

    draw2d.SnapToGrid( workflow)

Version: 0.9.14
Author: Andreas Herz

Method Detail

### snapPoint

    Object snapPoint( direction, inputPoint, resultPoint)

Applies a snapping correction to the given result. Snapping can occur in the four primary directions: NORTH, SOUTH, EAST, WEST, as defined on draw2d.PositionConstants. By default a Point is treated as an empty Rectangle. Only NORTH and WEST should be used in general. But SOUTH and EAST may also be used. Similarly, VERTICAL and HORIZONTAL may be used to allow a point to snap to the "center" or "middle" as defined by the concrete subclass.

### snapRectangle

    Object snapRectangle( inputBounds, resultBounds)

Applies a snap correction to a Rectangle based on a given Rectangle. The provided baseRect will be used as a reference for snapping. The types of snapping to be performed are indicated by the snapOrientation parameter. The correction is applied to the result field.

All coordinate information received and returned by this method should be in absolute coordinates.

Overview | File | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Thu Feb 7 23:45:47 2008