width property

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 => this.boundsTransformed.width;
void width= (num value)

Implementation

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