width property Null safety

num width

The width of this display object with the applied transformation.

Setting the width may change the scaleX, scaleY, skewX and skewY properties, depending on the previously applied transformation.

Implementation

num get width => boundsTransformed.width;
void width=(num value)

Implementation

set width(num value) {
  final bounds = this.bounds;
  final matrix = transformationMatrix;
  final boundsTransformed = matrix.transformRectangle(bounds, bounds);
  final scale = value / boundsTransformed.width;
  final ma = scale.isFinite ? matrix.a * scale : 1.0;
  final mc = scale.isFinite ? matrix.c * scale : 0.0;
  _reverseMatrix(ma, matrix.b, mc, matrix.d);
}