Skip to content

Commit

Permalink
Fix division by 0 on transform constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
umberto-sonnino committed Oct 24, 2019
1 parent f0cf988 commit d77438f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flare_dart/lib/math/mat2d.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class Mat2D {
double rotation = atan2(m1, m0);
double denom = m0 * m0 + m1 * m1;
double scaleX = sqrt(denom);
double scaleY = (m0 * m3 - m2 * m1) / scaleX;
double scaleY = (scaleX == 0) ? 0 : ((m0 * m3 - m2 * m1) / scaleX);
double skewX = atan2(m0 * m2 + m1 * m3, denom);

result[0] = m[4];
Expand Down

0 comments on commit d77438f

Please sign in to comment.