提交 96aadc99 编写于 作者: H Hixie

Rename "BorderSide.None" to "BorderSide.none", since it's a constant, and...

Rename "BorderSide.None" to "BorderSide.none", since it's a constant, and change the sky.Size.infinite() constructor to a constant.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1158263005
上级 10cda2fe
......@@ -12,11 +12,11 @@ class Size {
const Size(this.width, this.height);
const Size.infinite() : width = double.INFINITY, height = double.INFINITY;
const Size.fromWidth(this.width) : height = double.INFINITY;
const Size.fromHeight(this.height) : width = double.INFINITY;
static const Size infinite = const Size(double.INFINITY, double.INFINITY);
bool operator ==(other) => other is Size && width == other.width && height == other.height;
// does the equivalent of "return new Point(0,0) + this"
......
......@@ -38,7 +38,7 @@ class SpriteBox extends RenderBox {
double get systemHeight => _systemHeight;
void performLayout() {
size = constraints.constrain(new Size.infinite());
size = constraints.constrain(Size.infinite);
}
void handleEvent(Event event) {
......@@ -136,4 +136,4 @@ class SpriteBox extends RenderBox {
_rootNode.update(delta);
_scheduleTick();
}
}
\ No newline at end of file
}
......@@ -52,7 +52,7 @@ class InkWell extends RenderBox {
}
void performLayout() {
size = constraints.constrain(new sky.Size.infinite());
size = constraints.constrain(sky.Size.infinite);
}
void paint(RenderObjectDisplayList canvas) {
......
......@@ -62,7 +62,7 @@ class RenderTouchDemo extends RenderBox {
}
void performLayout() {
size = constraints.constrain(new Size.infinite());
size = constraints.constrain(Size.infinite);
}
void paint(RenderObjectDisplayList canvas) {
......
......@@ -115,7 +115,7 @@ class Drawer extends AnimatedComponent {
var mask = new EventListenerNode(
new Container(
desiredSize: new sky.Size.infinite(),
desiredSize: sky.Size.infinite,
decoration: new BoxDecoration(backgroundColor: maskColor)
),
onGestureTap: controller.handleMaskTap,
......
......@@ -75,7 +75,7 @@ class RenderScaffold extends RenderBox {
bool get sizedByParent => true;
void performResize() {
size = constraints.constrain(new sky.Size.infinite());
size = constraints.constrain(sky.Size.infinite);
assert(size.width < double.INFINITY);
assert(size.height < double.INFINITY);
}
......
......@@ -191,7 +191,7 @@ class RenderSizedBox extends RenderProxyBox {
RenderSizedBox({
RenderBox child,
sky.Size desiredSize: const sky.Size.infinite()
sky.Size desiredSize: sky.Size.infinite
}) : super(child) {
assert(desiredSize != null);
this.desiredSize = desiredSize;
......@@ -377,7 +377,7 @@ class BorderSide {
final sky.Color color;
final double width;
static const None = const BorderSide(width: 0.0);
static const none = const BorderSide(width: 0.0);
int get hashCode {
int value = 373;
......@@ -390,10 +390,10 @@ class BorderSide {
class Border {
const Border({
this.top: BorderSide.None,
this.right: BorderSide.None,
this.bottom: BorderSide.None,
this.left: BorderSide.None
this.top: BorderSide.none,
this.right: BorderSide.none,
this.bottom: BorderSide.none,
this.left: BorderSide.none
});
const Border.all(BorderSide side) :
top = side,
......
......@@ -23,11 +23,11 @@ class RenderStack extends RenderBox with ContainerRenderObjectMixin<RenderBox, S
}
sky.Size getIntrinsicDimensions(BoxConstraints constraints) {
return constraints.constrain(new sky.Size.infinite());
return constraints.constrain(sky.Size.infinite);
}
void performLayout() {
size = constraints.constrain(new sky.Size.infinite());
size = constraints.constrain(sky.Size.infinite);
assert(size.width < double.INFINITY);
assert(size.height < double.INFINITY);
BoxConstraints innerConstraints = new BoxConstraints.loose(size);
......
......@@ -15,7 +15,7 @@ class RenderSolidColor extends RenderDecoratedBox {
final sky.Size desiredSize;
final sky.Color backgroundColor;
RenderSolidColor(sky.Color backgroundColor, { this.desiredSize: const sky.Size.infinite() })
RenderSolidColor(sky.Color backgroundColor, { this.desiredSize: sky.Size.infinite })
: backgroundColor = backgroundColor,
super(decoration: new BoxDecoration(backgroundColor: backgroundColor)) {
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册