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

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

Issue 1196553004: Short-circuit the relayoutSubtreeRoot when the child couldn't change dimensions anyway because the … (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 | « no previous file | sky/sdk/lib/rendering/box.dart » ('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 cc7fdb2b50d5a6836fd77dc0fad7691c5443b7cd..0523a3672e8e23432357cf3232bc78a0a4942ba3 100644
--- a/sky/examples/rendering/sector_layout.dart
+++ b/sky/examples/rendering/sector_layout.dart
@@ -11,7 +11,7 @@ import 'package:sky/rendering/sky_binding.dart';
const double kTwoPi = 2 * math.PI;
-class SectorConstraints {
+class SectorConstraints extends Constraints {
const SectorConstraints({
this.minDeltaRadius: 0.0,
this.maxDeltaRadius: double.INFINITY,
@@ -37,6 +37,8 @@ class SectorConstraints {
double constrainDeltaTheta(double deltaTheta) {
return clamp(min: minDeltaTheta, max: maxDeltaTheta, value: deltaTheta);
}
+
+ bool get isTight => minDeltaTheta >= maxDeltaTheta && minDeltaTheta >= maxDeltaTheta;
}
class SectorDimensions {
@@ -72,7 +74,7 @@ abstract class RenderSector extends RenderObject {
return new SectorDimensions.withConstraints(constraints);
}
- SectorConstraints get constraints { SectorConstraints result = super.constraints; return result; }
+ SectorConstraints get constraints => super.constraints;
void performResize() {
// default behaviour for subclasses that have sizedByParent = true
deltaRadius = constraints.constrainDeltaRadius(0.0);
« no previous file with comments | « no previous file | sky/sdk/lib/rendering/box.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698