CanvasObjectConstraints class

Canvas object editing constraints.

Constraints are enforced by controller resize and move operations. Browser controllers automatically know the mounted canvas size; server-safe stubs can call CanvasController.setCanvasSize when preventOutsideCanvas is needed during tests or SSR-compatible logic.

Constructors

CanvasObjectConstraints({double minWidth = 1, double minHeight = 1, double? maxWidth, double? maxHeight, bool keepAspectRatio = false, bool lockMovementX = false, bool lockMovementY = false, bool preventOutsideCanvas = false})
Creates object editing constraints.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
keepAspectRatio → bool
Whether resize operations should preserve aspect ratio.
final
lockMovementX → bool
Whether horizontal movement is locked.
final
lockMovementY → bool
Whether vertical movement is locked.
final
maxHeight → double?
Optional maximum object height.
final
maxWidth → double?
Optional maximum object width.
final
minHeight → double
Minimum object height.
final
minWidth → double
Minimum object width.
final
preventOutsideCanvas → bool
Whether objects should stay inside the canvas viewport.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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