Cache intrinsic dimensions (#4446)
Also, make sure that the parent is notified when they change. Fixes #2298
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user