Remarks
See Also
Developer's Guide
API
- bounds
Members
Constructors
Initializes a new instance of the ViewportLimiter class.
Parameters
Properties
Gets or sets the maximal allowed navigable bounds for the viewport.
Property Value
null. This value will be used by the default implementation of limitViewport to crop the desired viewport to.See Also
Developer's Guide
Gets or sets the percentage of the width and height of the viewport that should be reserved *at least* when viewportContentMargins are defined.
0.8 for both dimensions, so 80% of the space is reserved for the contents and margins can take up at most 10% of the space on each side. In these cases this space is distributed such that it corresponds to the ratio of the left/right and/or top/bottom viewportContentMargins.Gets or sets the policy on how the viewport is limited if the current viewport is not within the limits.
Gets or sets a value that describes how bounds should be treated.
If set to true the viewport is limited in a way that the viewport must only show elements inside the bounds and no area outside the bounds should ever be visible. If the aspect ratio of the viewport and bounds differ, parts of the viewport will always be cropped as zooming out will be restricted by one axis. In video terminology, this setting is often referred to as "crop" or "cropping". When combined with projection, this feature will effectively prevent the user from reaching all parts within bounds without zooming in very far because the space around the "tips" of the bounds in the viewport are not aligned with the viewport.
If set to false the viewport is only limited in a way that while it is possible to see parts outside the bounds, the process tries to minimize the amount of possible space outside the bounds. If the aspect ratio of the viewport and bounds differ, 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, with this option, it will be possible to zoom out so that all bounds can be visible at the same time. When combined with projection, this feature will allow the user to fully see elements that lie at the border of bounds without zooming in very far because the viewport is allowed to go beyond the bounds, but only so far as not more whitespace will become visible than necessary to show more of the inside of the bounds.
Default is false.
Property Value
See Also
Developer's Guide
Gets or sets a value that determines whether the CanvasComponent's contentBounds should be implicitly used as the bounds to limit against.
true the contentBounds will be used as the bounds if none are specified, otherwise. getCurrentBoundingPolygon will obtain the bounds from the control if bounds is still unspecified (null). By default, this feature is enabled.See Also
Developer's Guide
API
- getCurrentBoundingPolygon
20.0 margins on all sides. If the horizontal or vertical margins exceed the space given by the minimumViewportContentRatio the available space is distributed such that it corresponds to the ratio of the left/right and/or top/bottom viewportContentMargins.See Also
Developer's Guide
Methods
Gets the bounding polygon that should be honored for the upcoming limiting call.
Parameters
- canvasComponent: CanvasComponent
- The canvas control.
- requestedViewport: ViewportDescriptor
- The requested new viewport.
- mode: ViewportLimitingMode
- The current limiting mode for the request.
Return Value
- Point
- The bounds in the world coordinate system in the form of a strictly convex polygon where the points are given in clockwise order.
nullif there are no restrictions.
See Also
Developer's Guide
Inspects the requested new viewport for the given CanvasComponent and returns a valid viewport to use.
Parameters
- canvasComponent: CanvasComponent
- The canvas on which the viewport should be applied.
- requestedViewport: ViewportDescriptor
- The viewport as requested by the caller.
- mode: ViewportLimitingMode
- A context that describes the current request. Specifically, this controls whether the current viewport should be honored and/or whether this change is an incremental, interactive, or programmatically triggered change. This is used for example by fitContent or ZOOM_TO_CURRENT_ITEM where larger viewport changes are expected, whereas interactive drags and scrollbar movements can be handled more gracefully depending on context.
Return Value
- ViewportDescriptor
- A valid viewport that should be used.
See Also
Developer's Guide