Packagecom.yworks.canvas.input
Interfacepublic interface IGridConstraintProvider

Interface for classes that can snap coordinates of items of a specific type to a grid.



Public Properties
 PropertyDefined By
  gridInfo : GridInfo
[read-only] Gets the grid info containing the canonic grid origin as well as the grid's horizontal and vertical spacing.
IGridConstraintProvider
Public Methods
 MethodDefined By
  
snapToGrid(context:IInputModeContext, item:Object, point:IPoint):IPoint
Performs the actual snapping to grid coordinates.
IGridConstraintProvider
Property Detail
gridInfoproperty
gridInfo:GridInfo  [read-only]

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
Method Detail
snapToGrid()method
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.