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

Side by Side Diff: sky/sdk/lib/framework/rendering/box.dart

Issue 1184483002: Teach stack to size to the max of its non-positioned children (Closed) Base URL: git@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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/sdk/lib/framework/rendering/stack.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 import 'object.dart'; 7 import 'object.dart';
8 import '../painting/box_painter.dart'; 8 import '../painting/box_painter.dart';
9 import 'package:vector_math/vector_math.dart'; 9 import 'package:vector_math/vector_math.dart';
10 import 'package:sky/framework/net/image_cache.dart' as image_cache; 10 import 'package:sky/framework/net/image_cache.dart' as image_cache;
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 } 395 }
396 396
397 String debugDescribeSettings(String prefix) => '${super.debugDescribeSettings( prefix)}${prefix}additionalConstraints: ${additionalConstraints}\n'; 397 String debugDescribeSettings(String prefix) => '${super.debugDescribeSettings( prefix)}${prefix}additionalConstraints: ${additionalConstraints}\n';
398 } 398 }
399 399
400 class RenderShrinkWrapWidth extends RenderProxyBox { 400 class RenderShrinkWrapWidth extends RenderProxyBox {
401 RenderShrinkWrapWidth({ RenderBox child }) : super(child); 401 RenderShrinkWrapWidth({ RenderBox child }) : super(child);
402 402
403 BoxConstraints _getInnerConstraints(BoxConstraints constraints) { 403 BoxConstraints _getInnerConstraints(BoxConstraints constraints) {
404 double width = child.getMaxIntrinsicWidth(constraints); 404 double width = child.getMaxIntrinsicWidth(constraints);
405 if (width != constraints.constrainWidth(width)) {
406 print ("$width $constraints");
407 }
405 assert(width == constraints.constrainWidth(width)); 408 assert(width == constraints.constrainWidth(width));
406 return constraints.applyWidth(width); 409 return constraints.applyWidth(width);
407 } 410 }
408 411
409 double getMinIntrinsicWidth(BoxConstraints constraints) { 412 double getMinIntrinsicWidth(BoxConstraints constraints) {
410 if (child != null) 413 if (child != null)
411 return child.getMaxIntrinsicWidth(constraints); 414 return child.getMaxIntrinsicWidth(constraints);
412 return constraints.constrainWidth(0.0); 415 return constraints.constrainWidth(0.0);
413 } 416 }
414 417
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 952
950 void defaultPaint(RenderObjectDisplayList canvas) { 953 void defaultPaint(RenderObjectDisplayList canvas) {
951 RenderBox child = firstChild; 954 RenderBox child = firstChild;
952 while (child != null) { 955 while (child != null) {
953 assert(child.parentData is ParentDataType); 956 assert(child.parentData is ParentDataType);
954 canvas.paintChild(child, child.parentData.position); 957 canvas.paintChild(child, child.parentData.position);
955 child = child.parentData.nextSibling; 958 child = child.parentData.nextSibling;
956 } 959 }
957 } 960 }
958 } 961 }
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/lib/framework/rendering/stack.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698