Line data Source code
1 : import 'dart:math'; 2 : import 'dart:ui'; 3 : 4 : import 'vector2.dart'; 5 : 6 : export 'dart:ui' show Size; 7 : 8 : extension SizeExtension on Size { 9 : /// Creates an [Offset] from the [Size] 10 0 : Offset toOffset() => Offset(width, height); 11 : 12 : /// Creates a [Vector2] from the [Size] 13 52 : Vector2 toVector2() => Vector2(width, height); 14 : 15 : /// Creates a [Point] from the [Size] 16 0 : Point toPoint() => Point(width, height); 17 : 18 : /// Creates a [Rect] from the [Size] 19 0 : Rect toRect() => Rect.fromLTWH(0, 0, width, height); 20 : }