Skip to content

Commit

Permalink
Support single-argument signature in Canvas.scale() (flutter#5334)
Browse files Browse the repository at this point in the history
  • Loading branch information
tvolkert authored May 22, 2018
1 parent fc0b9a6 commit dee0a22
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ui/painting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit dee0a22

Please sign in to comment.