Improve asserts around BoxConstraints

Negative constraints never make sense, so catch those too.

Make RenderObject.layout's isNormalized assert use the newer more fancy
debug version of isNormalized.
This commit is contained in:
Hixie
2016-02-10 10:54:26 -08:00
parent 96405fb42f
commit 3bd8bc3362
3 changed files with 21 additions and 4 deletions

View File

@@ -39,6 +39,10 @@ class SectorConstraints extends Constraints {
bool get isTight => minDeltaTheta >= maxDeltaTheta && minDeltaTheta >= maxDeltaTheta;
bool get isNormalized => minDeltaRadius <= maxDeltaRadius && minDeltaTheta <= maxDeltaTheta;
bool get debugAssertIsNormalized {
assert(isNormalized);
return isNormalized;
}
}
class SectorDimensions {