interface RVG · Viewports
RvgViewport
interface RvgViewport extends RvgVisual
A box or circle that shows a part of a larger drawing: content in world coordinates, placed by
origin, clipped to the boundary.
A viewport is a group with three parts. content holds the drawing in world coordinates; its
anchor is origin, so setting origin pans, zooms and turns it. frame is the viewport itself:
what is created there (a border, a scale, a legend) is drawn above the content, does not move
with origin, and is clipped to the boundary too. The boundary is in the viewport's own
coordinates; anchor places these in the parent group.
Viewports computes new origins (pan, zoom, fit, focus) and converts between world and viewport
coordinates. interactive switches user panning and zooming on and off.
Properties
anchorreadonly
anchor: PinPlaces the viewport in its parent group, as the anchor of any group does.
contentreadonly
content: RvgGroupThe group for the drawing; its coordinates are world coordinates.
framereadonly
frame: RvgGroupThe viewport itself as a group: visuals created here are drawn above the content and don't
move with origin.
interactivereadonly
interactive: RvgViewportControllerSwitches user panning and zooming.
originreadonly
origin: PinWhere the world is shown: its position is where world (0, 0) appears in viewport coordinates (the pan), its direction holds the zoom (length) and the rotation (angle).
The default, (0, 0) with direction (1, 0), shows the world unmoved. Set it directly, with a
Viewports function and result, or animate it with Animate.pin.
Inherited
From RvgVisual applyStyleDirective, fromGraphic, getVisualBoundingBox, mounted, toGraphic, visible, zIndex
