| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |