ViewportTransform class

The world→screen affine, held in Float64 for its whole life.

Screen coordinates are logical pixels with y down; world coordinates are document units with y up, which the fitting constructor flips. Nothing here ever hands an absolute world coordinate to dart:ui — see CameraController and the rebase origin for why that matters at 4.5e6.

Annotations

Constructors

ViewportTransform({required Transform2 worldToScreenMatrix})
ViewportTransform.fit(Aabb2 world, Size viewport)
Fits world into viewport with a 5% margin, y flipped.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scale → double
Geometric mean of the axis scales — the number stroke widths divide by.
no setter
worldToScreenMatrix → Transform2
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
screenToWorld(Vector2 screen) → Vector2
screenToWorldInto(double sx, double sy, Vector2 out) → Vector2
screenToWorld of the screen point (sx, sy), written into out and returned: no allocation, for a re-target on every camera change.
toString() → String
A string representation of this object.
inherited
visibleWorld(Size viewport) → Aabb2
The world-space AABB of the viewport rectangle.
worldToScreen(Vector2 world) → Vector2

Operators

operator ==(Object other) → bool
The equality operator.
inherited