From 84d362232120278a202c92a6cb4d74fbbd6cbde1 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Tue, 22 May 2018 12:10:38 -0700 Subject: [PATCH] Support single-argument signature in Canvas.scale() (flutter/engine#5334) --- engine/src/flutter/lib/ui/painting.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/lib/ui/painting.dart b/engine/src/flutter/lib/ui/painting.dart index 4fad77563e..6973bd2052 100644 --- a/engine/src/flutter/lib/ui/painting.dart +++ b/engine/src/flutter/lib/ui/painting.dart @@ -2756,7 +2756,12 @@ class Canvas extends NativeFieldWrapperClass2 { /// Add an axis-aligned scale to the current transform, scaling by the first /// argument in the horizontal direction and the second in the vertical /// direction. - void scale(double sx, double sy) native 'Canvas_scale'; + /// + /// If [sy] is unspecified, [sx] will be used for the scale in both + /// directions. + void scale(double sx, [double sy]) => _scale(sx, sy ?? sx); + + void _scale(double sx, double sy) native 'Canvas_scale'; /// Add a rotation to the current transform. The argument is in radians clockwise. void rotate(double radians) native 'Canvas_rotate';