Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Unified Diff: sky/examples/rendering/sector_layout.dart

Issue 1213473003: Add asserts to catch potential misuses of the rendering framework. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/painting/Size.dart ('k') | sky/sdk/lib/rendering/README.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/rendering/sector_layout.dart
diff --git a/sky/examples/rendering/sector_layout.dart b/sky/examples/rendering/sector_layout.dart
index b17b31b98cee3d9d61ebcfbfed6565fe313be2c4..85dcc41691f603735023bbd517748b90112e78ec 100644
--- a/sky/examples/rendering/sector_layout.dart
+++ b/sky/examples/rendering/sector_layout.dart
@@ -75,6 +75,17 @@ abstract class RenderSector extends RenderObject {
}
SectorConstraints get constraints => super.constraints;
+ bool debugDoesMeetConstraints() {
+ assert(constraints != null);
+ assert(deltaRadius != null);
+ assert(deltaRadius < double.INFINITY);
+ assert(deltaTheta != null);
+ assert(deltaTheta < double.INFINITY);
+ return constraints.minDeltaRadius <= deltaRadius &&
+ deltaRadius <= math.max(constraints.minDeltaRadius, constraints.maxDeltaRadius) &&
+ constraints.minDeltaTheta <= deltaTheta &&
+ deltaTheta <= math.max(constraints.minDeltaTheta, constraints.maxDeltaTheta);
+ }
void performResize() {
// default behaviour for subclasses that have sizedByParent = true
deltaRadius = constraints.constrainDeltaRadius(0.0);
« no previous file with comments | « sky/engine/core/painting/Size.dart ('k') | sky/sdk/lib/rendering/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698