This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. Extensions can be found in the GoJS kit under the `extensions` or `extensionsTS` folders. See the Extensions intro page for more information.

### Hierarchy

- Tool
  - LinkReshapingTool
    - SnapLinkReshapingTool

The SnapLinkReshapingTool class lets the user snap link reshaping handles to the nearest grid point.

If you want to experiment with this extension, try the Snap Link Reshaping sample.

## Index

### Properties

- gridCellSize
- gridOrigin
- isGridSnapEnabled

### Methods

- computeReshape

## Properties

### gridCellSize : Size

- Gets or sets the Size of each grid cell to which link points will be snapped.

  The default value is NaNxNaN, which means use the Diagram.grid's Panel.gridCellSize.

### gridOrigin : Point

- Gets or sets the Point origin for the grid to which link points will be snapped.

  The default value is NaN,NaN, which means use the Diagram.grid's Panel.gridOrigin.

### isGridSnapEnabled : boolean

- Gets or sets whether a reshape handle's position should be snapped to a grid point. This affects the behavior of computeReshape.

  The default value is true.

## Methods

### Override computeReshape

- computeReshape(p: Point): Point

- Pretend while dragging a reshape handle the mouse point is at the nearest grid point, if isGridSnapEnabled is true. This uses gridCellSize and gridOrigin, unless those are not real values, in which case this uses the Diagram.grid's Panel.gridCellSize and Panel.gridOrigin.

  #### Parameters

  - ##### p: Point

  #### Returns Point

Copyright © 1998-2019 by Northwoods Software Corporation.