Readonly
childThe Viewport's child. Painting and layout will be relative to this.
Layout constraints of viewport when resolving widget's layout. A 4-tuple containing, respectively, minimum width, maximum width, minimum height and maximum height.
By default, has no minimum width nor height and unconstrained maximum width and height.
The offset of the child inside the Viewport. Depending on the Viewport implementation, this may update the actual position of the child Widget, or it may just affect how the paint method behaves.
The parent Viewport of this Viewport. Since positions are relative to this, absolute positions can be calculated by following all the parents.
If null, this is the topmost Viewport and owned by the UI Root.
Should be set by the owner when the owner is attached or detached.
The actual dimensions and position of the viewport, relative to the parent Viewport (or the UI Root if there is no parent Viewport, meaning that positions are absolute in that case); for example, this would be the equivalent to an iframe's dimensions and position (the HTML body in the iframe can have different dimensions than the iframe itself and be scrolled by some amount).
Do not use this value for resolving the layout. Only use this for event handling or other logic that doesn't affect layout.
Should be set by the owner of the Viewport (a Root or a ViewportWidget) when finalizing layout.
Readonly
relativeThe coordinate system used for this Viewport. If true, then coordinates are relative to the Viewport itself (child always has a position of 0,0). If false, then coordinates are absolute (relative to the nearest relative parent Viewport, or topmost Viewport, or 0,0 if this is the topmost Viewport).
Static
Protected
dimensionlessHas the warning for dimensionless canvases been issued?
Static
Protected
maxThe maximum retries allowed for resolving the layout. The first attempt is not counted. Only retries that exceed this limit are discarded; if maxRelayout is 4, then the 5th retry will be discarded.
Static
Protected
powerHas the warning for non-power of 2 dimensions been issued?
The render target's (canvas) 2D context. Alpha is enabled.
Note that readonly in this context means that this property is a getter, not that it is immutable. Ideally, this is a getter that gets the current rendering context. Some Viewport implementations (such as CanvasViewport) will always use the same context, while others (such as ClippedViewport) will occasionally change the context.
Get the canvas scale that will be applied to the Viewport's child. Used for checking whether a child's dimensions exceeds a canvas' maximum dimensions.
Note that readonly in this context means that this property is a getter, not that it is immutable. Ideally, this is a getter that calculates the effective scale of the viewport via the canvas dimensions and max dimensions, which may returns different values, not the same value every time.
Protected
getGet the rect of the child alongside more extra information, clipped/clamped to the bounds of the viewport. For internal use only.
Resolves the given child's layout by calling resolveDimensionsAsTop with the current constraints, resolvePosition and finalizeBounds.
Handles both relative and absolute coordinates. The previous position is used.
Returns true if the child was resized, else, false.
Generated using TypeDoc
A Viewport which inherits a rendering context from the closest parent Viewport and paints Widgets by clipping them to the Viewport's rectangle.