mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Replace BoxDimensions with sky.Size
R=ianh@google.com Review URL: https://codereview.chromium.org/1150253005
This commit is contained in:
parent
b0e39b7d99
commit
3f22019e66
@ -16,10 +16,8 @@ class RenderSolidColor extends RenderDecoratedBox {
|
||||
: backgroundColor = backgroundColor,
|
||||
super(new BoxDecoration(backgroundColor: backgroundColor));
|
||||
|
||||
BoxDimensions getIntrinsicDimensions(BoxConstraints constraints) {
|
||||
return new BoxDimensions.withConstraints(constraints,
|
||||
height: desiredHeight,
|
||||
width: desiredWidth);
|
||||
Size getIntrinsicDimensions(BoxConstraints constraints) {
|
||||
return constraints.constrain(new Size(desiredWidth, desiredHeight));
|
||||
}
|
||||
|
||||
void performLayout() {
|
||||
|
||||
@ -398,16 +398,16 @@ class RenderBoxToRenderSectorAdapter extends RenderBox {
|
||||
child.parentData = new SectorParentData();
|
||||
}
|
||||
|
||||
BoxDimensions getIntrinsicDimensions(BoxConstraints constraints) {
|
||||
sky.Size getIntrinsicDimensions(BoxConstraints constraints) {
|
||||
if (child == null)
|
||||
return new BoxDimensions.withConstraints(constraints, width: 0.0, height: 0.0);
|
||||
return constraints.constrain(new sky.Size(0.0, 0.0));
|
||||
assert(child is RenderSector);
|
||||
assert(child.parentData is SectorParentData);
|
||||
assert(!constraints.isInfinite);
|
||||
double maxChildDeltaRadius = math.min(constraints.maxWidth, constraints.maxHeight) / 2.0 - innerRadius;
|
||||
SectorDimensions childDimensions = child.getIntrinsicDimensions(new SectorConstraints(maxDeltaRadius: maxChildDeltaRadius), innerRadius);
|
||||
double dimension = (innerRadius + childDimensions.deltaRadius) * 2.0;
|
||||
return new BoxDimensions.withConstraints(constraints, width: dimension, height: dimension);
|
||||
return constraints.constrain(new sky.Size(dimension, dimension));
|
||||
}
|
||||
|
||||
void performLayout() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user