applyTransformation method

void applyTransformation(
  1. CanvasTransformation transformation,
  2. Size canvasSize
)

Implementation

void applyTransformation(
  CanvasTransformation transformation,
  Size canvasSize,
) {
  if (transformation.scale != null) {
    scale(transformation.scale!.x.toDouble(),
        transformation.scale!.y.toDouble());
  }
  if (transformation.translate != null) {
    translate(
      transformation.translate!.x.toDouble() * canvasSize.width,
      transformation.translate!.y.toDouble() * canvasSize.height,
    );
  }
}