DiagramCameraGeometry extension

Viewport mathematics for a camera state.

on

Properties

visibleWorldBounds → DiagramRect

Available on DiagramCameraState, provided by the DiagramCameraGeometry extension

no setter

Methods

clampedTo(CanvasBounds canvas, DiagramRect? content) → DiagramCameraState

Available on DiagramCameraState, provided by the DiagramCameraGeometry extension

This camera with its center kept within canvas: the extent of content, or a viewport-sized canvas around the origin when there is none, with the canvas padding in viewport pixels around it.
forBounds(DiagramRect bounds, {double padding = 48}) → DiagramCameraState

Available on DiagramCameraState, provided by the DiagramCameraGeometry extension

This camera fitted to bounds, leaving padding around them.
forWidth(DiagramRect bounds, {double padding = 48}) → DiagramCameraState

Available on DiagramCameraState, provided by the DiagramCameraGeometry extension

This camera fitted to the width of bounds.
screenToWorld(DiagramPoint screen) → DiagramPoint

Available on DiagramCameraState, provided by the DiagramCameraGeometry extension

worldToScreen(DiagramPoint world) → DiagramPoint

Available on DiagramCameraState, provided by the DiagramCameraGeometry extension