CanvasViewportPolicy class

Generic runtime viewport policy.

This does not know about product-specific content or editor UX. It only describes which world rect should be fitted into a viewport.

Constructors

CanvasViewportPolicy({CanvasViewportSource source = CanvasViewportSource.artboard, CanvasFit fit = CanvasFit.contain, double paddingPx = 24, bool tight = false, double? minUniformScale, double? maxUniformScale, bool snappingEnabled = false, double pixelRatioForSnapping = 1.0})
const
CanvasViewportPolicy.artboard({CanvasFit fit = CanvasFit.contain, double paddingPx = 24, double? minUniformScale, double? maxUniformScale, bool snappingEnabled = false, double pixelRatioForSnapping = 1.0})
const
CanvasViewportPolicy.contentBounds({CanvasFit fit = CanvasFit.contain, double paddingPx = 24, bool tight = false, double? minUniformScale, double? maxUniformScale, bool snappingEnabled = false, double pixelRatioForSnapping = 1.0})
const

Properties

fit CanvasFit
final
hashCode int
The hash code for this object.
no setterinherited
maxUniformScale double?
final
minUniformScale double?
final
paddingPx double
Viewport fitting margin.
final
pixelRatioForSnapping double
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snappingEnabled bool
final
source CanvasViewportSource
final
tight bool
Export-style tight output sizing. Interactive editor viewports can ignore it.
final
usesContentBounds bool
no setter

Methods

boundsFor({required Rect2D? contentBounds}) Rect2D?
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
plan({required Size2D artboard, required double targetW, required double targetH, Rect2D? contentBounds, double bleedPx = 0}) CanvasViewportPlanResult
toString() String
A string representation of this object.
inherited

Operators

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