Inheritance Hierarchy
Remarks
Instances of this class are created by collectSameSizeSnapReferences to snap to the widths or heights of fixedNodes.
Members
Show:
Constructors
Parameters
- horizontal: boolean
- Whether this instance shall be used to snap the width of an item. If
falsethe height should be snapped instead. - size: number
- The size to snap to.
- rectangles: IEnumerable<Rect>
- A list of rectangles with equal width or height, depending on
horizontal. - weight: number
- The weight (importance) of this snap reference. If more than one snap reference is snapped to, the one with the greater weight will be used.
- snappableItems?: GraphItemTypes
- The graph item types that may snap to this snap reference.
- tag?: any
- A tag that is associated with this snap reference - see tag for a typical use of this value.
Properties
Gets if size is the width or height of the rectangles.
Gets if size is the width or height of the rectangles.
readonlyfinal
Gets the rectangles that have the same size.
Gets the rectangles that have the same size.
These rectangles can be used when visualizing the snapped size.
readonlyfinal
This size is the width if horizontal is
true and the height otherwise.readonlyfinal
Gets which types of items may snap to this snap reference.
Gets which types of items may snap to this snap reference.
readonlyfinal
Defined in
SnapReference.snappableItemsThe tag is most commonly used for the snap result tag.
readonlyfinal
Defined in
SnapReference.tagGreater values indicate greater importance.
readonlyfinal
Defined in
SnapReference.weightMethods
Calculates a valid SnapResult that snaps the width or height of a reshaped rectangle to the size.
Calculates a valid SnapResult that snaps the width or height of a reshaped rectangle to the size.
Depending on horizontal, the width or height of the reshaped rectangle is snapped.
The reshape behavior of the rectangle relative to the pointer movement is described by the reshapeContext and a snap result is only considered to be valid, if the necessary pointer delta resulting in the snap is not bigger than the snapDistance.
If a valid SnapResult is found, it is added to the evt and returned.
Parameters
- evt: CollectSnapResultsEventArgs
- The arguments describing the movement the SnapResult shall be created for.
- reshapeContext: ReshapeRectangleContext
- The reshape context that contains information about the nature of the resize.
- reshapedItem: IModelItem
- The item that is currently reshaped.
- suggestedLayout: Rect
- The layout of the item as it would be if the pointer location would not be snapped.
Return Value
- SnapResult
- A valid snap result to the size or
nullif no such snap result could be found.