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

Unified Diff: sky/sdk/lib/rendering/box.dart

Issue 1215163003: Random cleanup of various Dart things in our tree. (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/sdk/lib/mojo/asset_bundle.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/rendering/box.dart
diff --git a/sky/sdk/lib/rendering/box.dart b/sky/sdk/lib/rendering/box.dart
index 36a3e12f94c49b7a576c1bcaa500619786435d06..f6de4f4e61b2d15e7ffe112e9b3e8e9695d5a476 100644
--- a/sky/sdk/lib/rendering/box.dart
+++ b/sky/sdk/lib/rendering/box.dart
@@ -321,7 +321,10 @@ abstract class RenderBox extends RenderObject {
assert(constraints != null);
assert(_size != null);
assert(!_size.isInfinite);
- return constraints.contains(_size);
+ bool result = constraints.contains(_size);
+ if (!result)
+ print("${this.runtimeType} does not meet its constraints. Constraints: $constraints, size: $_size");
+ return result;
}
void performResize() {
// default behaviour for subclasses that have sizedByParent = true
@@ -763,17 +766,21 @@ class RenderPadding extends RenderShiftedBox {
void performLayout() {
assert(padding != null);
- BoxConstraints innerConstraints = constraints.deflate(padding);
if (child == null) {
- size = innerConstraints.constrain(
- new Size(padding.left + padding.right, padding.top + padding.bottom));
+ size = constraints.constrain(new Size(
+ padding.left + padding.right,
+ padding.top + padding.bottom
+ ));
return;
}
+ BoxConstraints innerConstraints = constraints.deflate(padding);
child.layout(innerConstraints, parentUsesSize: true);
assert(child.parentData is BoxParentData);
child.parentData.position = new Point(padding.left, padding.top);
- size = constraints.constrain(new Size(padding.left + child.size.width + padding.right,
- padding.top + child.size.height + padding.bottom));
+ size = constraints.constrain(new Size(
+ padding.left + child.size.width + padding.right,
+ padding.top + child.size.height + padding.bottom
+ ));
}
String debugDescribeSettings(String prefix) => '${super.debugDescribeSettings(prefix)}${prefix}padding: ${padding}\n';
@@ -1154,6 +1161,10 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
markNeedsLayout();
}
+ // We never call layout() on this class, so this should never get
+ // checked. (This class is laid out using scheduleInitialLayout().)
+ bool debugDoesMeetConstraints() { assert(false); return false; }
+
void performResize() {
assert(false);
}
« no previous file with comments | « sky/sdk/lib/mojo/asset_bundle.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698