Skip to content

Commit 3d876dd

Browse files
committed
Resizing refactor #6
- Add more tests.
1 parent c7605c2 commit 3d876dd

File tree

2 files changed

+865
-6
lines changed

2 files changed

+865
-6
lines changed

packages/box_transform/lib/src/geometry.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ class Constraints {
2424
this.maxWidth = double.infinity,
2525
this.minHeight = 0.0,
2626
this.maxHeight = double.infinity,
27-
});
27+
}) : assert(minWidth >= 0),
28+
assert(maxWidth >= 0),
29+
assert(minHeight >= 0),
30+
assert(maxHeight >= 0),
31+
assert(minWidth <= maxWidth),
32+
assert(minHeight <= maxHeight);
2833

2934
/// Creates a new unconstrained [Constraints] object.
3035
const Constraints.unconstrained()
@@ -183,11 +188,6 @@ class Dimension {
183188
/// * [isFinite], which checks whether both dimensions are finite.
184189
static const Dimension infinite = Dimension(double.infinity, double.infinity);
185190

186-
/// Whether this size encloses a non-zero area.
187-
///
188-
/// Negative areas are considered empty.
189-
bool get isEmpty => width <= 0.0 || height <= 0.0;
190-
191191
/// Removes [other] from this size.
192192
Dimension operator -(Dimension other) =>
193193
Dimension(width - other.width, height - other.height);

0 commit comments

Comments
 (0)