ZoomTransform class

A class representing a zoom transformation with scale and translation.

ZoomTransform encapsulates the state of a zoom/pan operation, including the scale factor and translation offsets.

Constructors

ZoomTransform({double scale = 1.0, double translateX = 0.0, double translateY = 0.0})
Creates a ZoomTransform.
const
ZoomTransform.scale(double scale)
Creates a ZoomTransform from a scale value.
factory
ZoomTransform.translate(double x, double y)
Creates a ZoomTransform from a translation.
factory
ZoomTransform.translateOffset(Offset offset)
Creates a ZoomTransform from an Offset translation.
factory

Properties

hashCode → int
The hash code for this object.
no setteroverride
inverse → ZoomTransform
Returns the inverse of this transform.
no setter
isIdentity → bool
Whether this is the identity transform.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scale → double
The scale factor.
final
translate → Offset
The translation as an Offset.
no setter
translateX → double
The horizontal translation.
final
translateY → double
The vertical translation.
final

Methods

apply(Offset point) → Offset
Applies this transform to a point.
applyToRect(Rect rect) → Rect
Applies this transform to a rectangle.
compose(ZoomTransform other) → ZoomTransform
Composes this transform with another.
copyWith({double? scale, double? translateX, double? translateY}) → ZoomTransform
Creates a copy with updated values.
copyWithTranslate(Offset translate) → ZoomTransform
Creates a copy with translation from an Offset.
invert(Offset point) → Offset
Applies the inverse of this transform to a point.
invertRect(Rect rect) → Rect
Applies the inverse transform to a rectangle.
lerp(ZoomTransform other, double t) → ZoomTransform
Interpolates between this transform and another.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rescale(double newScale, Offset focalPoint) → ZoomTransform
Rescales to a new scale around a focal point.
toMatrix4() → Matrix4
Converts this transform to a Matrix4.
toString() → String
A string representation of this object.
override

Operators

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

Constants

identity → const ZoomTransform
The identity transform (no zoom, no pan).