Skip to content

Commit

Permalink
Add a Rect.largest constructor equivalent to SkRect::MakeLargest (flu…
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-simmons authored Jan 5, 2018
1 parent 4b2c0c4 commit bbefdf1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/ui/geometry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,16 @@ class Rect {
..[3] = math.max(a.dy, b.dy);
}

/// Construct the largest finite rectangle.
Rect.largest() {
const double skScalarMax = 3.402823466e+38; // from Skia's SkScalar.h
_value
..[0] = -skScalarMax
..[1] = -skScalarMax
..[2] = skScalarMax
..[3] = skScalarMax;
}

static const int _kDataSize = 4;
final Float32List _value = new Float32List(_kDataSize);

Expand Down

0 comments on commit bbefdf1

Please sign in to comment.