Carries information about a reshape operation.
Remarks
Type Details
- yFiles module
- view
Constructors
ReshapeRectangleContext
(initialLayout: Rect, minimumSize: ISize, maximumSize: ISize, minimumEnclosedArea: IRectangle, maximumBoundingArea: IRectangle, reshapePosition: HandlePositions, topLeftChangeFactor: Point, bottomRightChangeFactor: Point, sizeChangeFactor: Size, reshapePolicy: ReshapePolicy, ratio: number)Initializes a new instance of the ReshapeRectangleContext class.
Parameters
A map of options to pass to the method.
- initialLayout - Rect
- The initial layout of the node.
- minimumSize - ISize
- The minimum size of the node.
- maximumSize - ISize
- The maximum size of the node.
- minimumEnclosedArea - IRectangle
- The minimum area the node's layout needs to encompass. Providing an EMPTY rectangle will disable this restriction.
- maximumBoundingArea - IRectangle
- The maximum bounding area the node's layout may fill. Providing an INFINITE rectangle will disable this restriction.
- reshapePosition - HandlePositions
- The position of the reshape handle.
- topLeftChangeFactor - Point
- The factor by which the top left corner of the node layout changes when the handle is dragged.
- bottomRightChangeFactor - Point
- The factor by which the bottom right corner of the node layout changes when the handle is dragged.
- sizeChangeFactor - Size
- The factor by which the size of the node layout changes when the handle is dragged.
- reshapePolicy - ReshapePolicy
- The policy used for aspect ratio resizing.
- ratio - number
- The aspect ratio used for aspect ratio resizing.
Properties
Gets the factor by which the bottom right corner of the node layout changes when the handle is dragged.
Property Value
Gets the initial layout of the node.
Property Value
Gets or sets the maximum size of the node.
Property Value
Gets the minimum area the node's layout needs to encompass.
Property Value
Gets the minimum size of the node.
Property Value
Gets the ratio between the change of the width and the change of the height that is kept during the reshape gesture.
Gets the position of the reshape handle.
Property Value
Gets the factor by which the size of the node layout changes when the handle is dragged.
Property Value
Gets the factor by which the top left corner of the node layout changes when the handle is dragged.
Property Value
Methods
calculateConstraintForBottomLocation
(evt: CollectSnapResultsEventArgs, suggestedLayout: Rect, delta: Point, snapLocation: number, snapDistance: number) : SnapConstraintCalculates a constraint for pointer locations so that the bottom side of the rectangle ends up at the snapLocation
.
Remarks
delta
.Parameters
A map of options to pass to the method.
- evt - CollectSnapResultsEventArgs
- The event argument to obtain the context from.
- suggestedLayout - Rect
- The suggested, unsnapped layout.
- delta - Point
- The current delta of the pointer location.
- snapLocation - number
- The y-coordinate at which the bottom rectangle side should end up.
- snapDistance - number
- A maximum valid distance from the current pointer location.
Returns
- ↪SnapConstraint?
- A SnapConstraint for pointer locations that change the bottom side of the rectangle to end up at the
snapLocation
ornull
if there are no pointer locations insnapDistance
that would move the bottom rectangle side tosnapLocation
.
calculateConstraintForHeight
(evt: CollectSnapResultsEventArgs, suggestedLayout: Rect, delta: Point, height: number, snapDistance: number) : SnapConstraintCalculates a constraint for pointer locations so that the node height ends up to be height
.
Remarks
delta
.Parameters
A map of options to pass to the method.
- evt - CollectSnapResultsEventArgs
- The event argument to obtain the context from.
- suggestedLayout - Rect
- The suggested, unsnapped layout.
- delta - Point
- The delta of the pointer location.
- height - number
- The new height of the node layout.
- snapDistance - number
- A maximum valid distance from the current pointer location.
Returns
- ↪SnapConstraint?
- A SnapConstraint for pointer locations that change the node height to
height
ornull
if there are no pointer locations insnapDistance
satisfying the size change.
calculateConstraintForLeftLocation
(evt: CollectSnapResultsEventArgs, suggestedLayout: Rect, delta: Point, snapLocation: number, snapDistance: number) : SnapConstraintCalculates a constraint for pointer locations so that the left side of the rectangle ends up at the snapLocation
.
Remarks
delta
.Parameters
A map of options to pass to the method.
- evt - CollectSnapResultsEventArgs
- The event argument to obtain the context from.
- suggestedLayout - Rect
- The suggested, unsnapped layout.
- delta - Point
- The delta of the pointer location.
- snapLocation - number
- The horizontal coordinate at which the left rectangle side should end up.
- snapDistance - number
- A maximum valid distance from the current pointer location.
Returns
- ↪SnapConstraint?
- A SnapConstraint for pointer locations that change the left side of the rectangle to end up at the
snapLocation
ornull
if there are no pointer locations insnapDistance
that would move the left rectangle side tosnapLocation
.
calculateConstraintForRightLocation
(evt: CollectSnapResultsEventArgs, suggestedLayout: Rect, delta: Point, snapLocation: number, snapDistance: number) : SnapConstraintCalculates a constraint for pointer locations so that the right side of the rectangle ends up at the snapLocation
.
Remarks
delta
.Parameters
A map of options to pass to the method.
- evt - CollectSnapResultsEventArgs
- The event argument to obtain the context from.
- suggestedLayout - Rect
- The suggested, unsnapped layout.
- delta - Point
- The delta of the pointer location.
- snapLocation - number
- The horizontal coordinate at which the right rectangle side should end up.
- snapDistance - number
- A maximum valid distance from the current pointer location.
Returns
- ↪SnapConstraint?
- A SnapConstraint for pointer locations that change the right side of the rectangle to end up at the
snapLocation
ornull
if there are no pointer locations insnapDistance
that would move the right rectangle side tosnapLocation
.
calculateConstraintForTopLocation
(evt: CollectSnapResultsEventArgs, suggestedLayout: Rect, delta: Point, snapLocation: number, snapDistance: number) : SnapConstraintCalculates a constraint for pointer locations so that the top side of the rectangle ends up at the snapLocation
.
Remarks
delta
.Parameters
A map of options to pass to the method.
- evt - CollectSnapResultsEventArgs
- The event argument to obtain the context from.
- suggestedLayout - Rect
- The suggested, unsnapped layout.
- delta - Point
- The delta of the pointer location.
- snapLocation - number
- The vertical coordinate at which the top rectangle side should end up.
- snapDistance - number
- A maximum valid distance from the current pointer location.
Returns
- ↪SnapConstraint?
- A SnapConstraint for pointer locations that change the top side of the rectangle to end up at the
snapLocation
ornull
if there are no pointer locations insnapDistance
that would move the top rectangle side tosnapLocation
.
calculateConstraintForWidth
(evt: CollectSnapResultsEventArgs, suggestedLayout: Rect, delta: Point, width: number, snapDistance: number) : SnapConstraintCalculates a constraint for pointer locations so that the node width ends up being width
.
Remarks
delta
.Parameters
A map of options to pass to the method.
- evt - CollectSnapResultsEventArgs
- The event argument to obtain the context from.
- suggestedLayout - Rect
- The suggested, unsnapped layout.
- delta - Point
- The delta of the pointer location.
- width - number
- The new width of the node layout.
- snapDistance - number
- A maximum valid distance from the current pointer location.
Returns
- ↪SnapConstraint?
- A SnapConstraint for pointer locations that change the node width to
width
ornull
if there are no pointer locations insnapDistance
satisfying the size change.