Cache intrinsic dimensions (#4446)

Also, make sure that the parent is notified when they change.

Fixes #2298
This commit is contained in:
Ian Hickson
2016-06-07 22:07:12 -07:00
parent 6c896dcc70
commit 007d0a2f39
29 changed files with 549 additions and 223 deletions

View File

@@ -454,28 +454,28 @@ class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChil
}
@override
double getMinIntrinsicWidth(double height) {
double computeMinIntrinsicWidth(double height) {
if (child == null)
return 0.0;
return getIntrinsicDimensions(height: height).width;
}
@override
double getMaxIntrinsicWidth(double height) {
double computeMaxIntrinsicWidth(double height) {
if (child == null)
return 0.0;
return getIntrinsicDimensions(height: height).width;
}
@override
double getMinIntrinsicHeight(double width) {
double computeMinIntrinsicHeight(double width) {
if (child == null)
return 0.0;
return getIntrinsicDimensions(width: width).height;
}
@override
double getMaxIntrinsicHeight(double width) {
double computeMaxIntrinsicHeight(double width) {
if (child == null)
return 0.0;
return getIntrinsicDimensions(width: width).height;

View File

@@ -14,22 +14,22 @@ class RenderSolidColorBox extends RenderDecoratedBox {
super(decoration: new BoxDecoration(backgroundColor: backgroundColor));
@override
double getMinIntrinsicWidth(double height) {
double computeMinIntrinsicWidth(double height) {
return desiredSize.width == double.INFINITY ? 0.0 : desiredSize.width;
}
@override
double getMaxIntrinsicWidth(double height) {
double computeMaxIntrinsicWidth(double height) {
return desiredSize.width == double.INFINITY ? 0.0 : desiredSize.width;
}
@override
double getMinIntrinsicHeight(double width) {
double computeMinIntrinsicHeight(double width) {
return desiredSize.height == double.INFINITY ? 0.0 : desiredSize.height;
}
@override
double getMaxIntrinsicHeight(double width) {
double computeMaxIntrinsicHeight(double width) {
return desiredSize.height == double.INFINITY ? 0.0 : desiredSize.height;
}