mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Add a Rect.largest constructor equivalent to SkRect::MakeLargest (flutter/engine#4520)
This commit is contained in:
parent
18d27b3e67
commit
fadef9db2f
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user