A simple integer based implementation of
IGridConstraintProvider
.
gridInfo:GridInfo
Gets the grid info containing the canonic grid origin as well as the grid's horizontal and vertical spacing.
Implementation public function get gridInfo():GridInfo
public function set gridInfo(value:GridInfo):void
public function SimpleGridConstraintProvider(gridInfo:GridInfo)
Creates a new instance using the given grid info.
Parameters | gridInfo:GridInfo — The info describing the grid's origin as well as it's horizontal and vertical spacing.
|
public function snapToGrid(context:IInputModeContext, item:Object, point:IPoint):IPoint
Performs the actual snapping to grid coordinates.
Parameters
| context:IInputModeContext — The context in which the snapping should occur.
|
|
| item:Object — The item of which the coordinates should be snapped.
|
|
| point:IPoint — The coordinates to snap.
|
Returns | IPoint — The closest grid point the given point can snap to.
|
Wed Oct 7 2015, 04:52 PM +02:00