Used by CanvasComponent to limit the interactive movement of the viewport.
Remarks
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.view.ViewportLimiter
See Also
Constructors
Initializes a new instance of the ViewportLimiter class.
Parameters
A map of options to pass to the method.
- honorBothDimensions - boolean
A value indicating whether both dimensions of bounds need to be honored. This option sets the honorBothDimensions property on the created object.
- bounds - Rect
The maximal allowed navigable bounds for the viewport. This option sets the bounds property on the created object.
- limitingPolicy - ViewportLimitingPolicy
The policy how the viewport is limited if the current viewport is not within the limits. This option sets the limitingPolicy property on the created object.
Properties
Gets or sets the maximal allowed navigable bounds for the viewport.
See Also
Gets or sets a value indicating whether both dimensions of bounds need to be honored.
Remarks
If set to true
the viewport is limited in a way that the viewport must fit in both width and height of the bounds. If the aspect ratio of viewport and bounds are different parts of the viewport will always be cropped. In video terminology this setting is often referred to as "crop" or "cropping". In other words, this option will ensure that the viewport does never contain parts outside the limited area.
If set to false
the viewport is only limited in the smaller dimension. If the aspect ratio of viewport and bounds are different parts of the viewport will be outside the limits. In video terminology this setting is often referred to as "letterbox" or "letterboxing". In other words, this option will ensure that the viewport is always filled in at least one dimension with the limited area.
Default is true
.
See Also
Gets or sets the policy how the viewport is limited if the current viewport is not within the limits.
Remarks
Methods
Gets the to bounds that should be honored for the upcoming call.
Remarks
Parameters
A map of options to pass to the method.
- canvas - CanvasComponent
- The canvas control.
- suggestedViewport - Rect
- The suggested viewport.
Returns
- ↪Rect
- The bounds to honor or
null
if there are no restrictions.
See Also
Inspects the desired or suggested new viewport for the given control and returns a valid viewport to use.
Parameters
A map of options to pass to the method.
- canvas - CanvasComponent
- The canvas control on which the viewport should be applied.
- suggestedViewport - Rect
- The suggested viewport.
- forceStrictLimits - boolean
- Whether to force STRICT limiting. Passing
true
overrides the limitingPolicy. This is used for example by fitContent or ZOOM_TO_CURRENT_ITEM where larger viewport changes are expected.
Returns
- ↪Rect
- The viewport that should be used.