ScalingTransform class

A coordinate system transformation to fit a ScalableImage into a given container, for a given BoxFit and Alignment. This class is offered as a convenience for scaling ScalableImage instances. It also helps converting positions as rendered back into the ScalableImage's coordinate, e.g. when mapping a touch event into the original SVG's coordinate space.

Constructors

ScalingTransform({required Size containerSize, required Rect siViewport, BoxFit fit = BoxFit.contain, Alignment alignment = Alignment.center})
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
scaleX double
The horizontal scale factor
final
scaleY double
The vertical scale factor
final
siViewport Rect
The ScalableImage.viewport of the image being transformed.
final
translateX double
The horizontal translation, before scaling is applied. This does not include any translation to the SI's viewport's origin. cf. ScalableImage.paint.
final
translateY double
The vertical translation, before scaling is applied. This does not include any translation to the SI's viewport's origin. cf. ScalableImage.paint.
final

Methods

applyToCanvas(Canvas canvas) → void
Apply this transform to the given Canvas, by first translating and then by scaling.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toContainerCoordinate(Offset si) Offset
Transform a point from the coordinate system of the ScalableImage into the container's coordinate system. This method adjusts for the origin of the SI's viewport.
toSICoordinate(Offset c) Offset
Transform a point from the coordinate system of the container into the ScalableImage's coordinate system. This method adjusts for the origin of the SI's viewport.
toString() String
A string representation of this object.
inherited

Operators

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