| Index: sky/sdk/lib/rendering/block.dart
|
| diff --git a/sky/sdk/lib/rendering/block.dart b/sky/sdk/lib/rendering/block.dart
|
| index 3a1ea069f5788406b7cabce2abb83a163d9facef..9faf7a6131c22423e3c0388af631e1502f96eb01 100644
|
| --- a/sky/sdk/lib/rendering/block.dart
|
| +++ b/sky/sdk/lib/rendering/block.dart
|
| @@ -21,6 +21,7 @@ abstract class RenderBlockBase extends RenderBox with ContainerRenderObjectMixin
|
| addAll(children);
|
| }
|
|
|
| + @override
|
| void setupParentData(RenderBox child) {
|
| if (child.parentData is! BlockParentData)
|
| child.parentData = new BlockParentData();
|
| @@ -29,11 +30,13 @@ abstract class RenderBlockBase extends RenderBox with ContainerRenderObjectMixin
|
| double _childrenHeight;
|
| double get childrenHeight => _childrenHeight;
|
|
|
| + @override
|
| void markNeedsLayout() {
|
| _childrenHeight = null;
|
| super.markNeedsLayout();
|
| }
|
|
|
| + @override
|
| void performLayout() {
|
| assert(constraints is BoxConstraints);
|
| double width = constraints.constrainWidth(constraints.maxWidth);
|
| @@ -58,6 +61,7 @@ class RenderBlock extends RenderBlockBase {
|
|
|
| RenderBlock({ List<RenderBox> children }) : super(children: children);
|
|
|
| + @override
|
| double getMinIntrinsicWidth(BoxConstraints constraints) {
|
| double width = 0.0;
|
| BoxConstraints innerConstraints = constraints.widthConstraints();
|
| @@ -70,6 +74,7 @@ class RenderBlock extends RenderBlockBase {
|
| return width;
|
| }
|
|
|
| + @override
|
| double getMaxIntrinsicWidth(BoxConstraints constraints) {
|
| double width = 0.0;
|
| BoxConstraints innerConstraints = constraints.widthConstraints();
|
| @@ -97,10 +102,12 @@ class RenderBlock extends RenderBlockBase {
|
| return height;
|
| }
|
|
|
| + @override
|
| double getMinIntrinsicHeight(BoxConstraints constraints) {
|
| return _getIntrinsicHeight(constraints);
|
| }
|
|
|
| + @override
|
| double getMaxIntrinsicHeight(BoxConstraints constraints) {
|
| return _getIntrinsicHeight(constraints);
|
| }
|
| @@ -111,6 +118,7 @@ class RenderBlock extends RenderBlockBase {
|
|
|
| bool _hasVisualOverflow = false;
|
|
|
| + @override
|
| void performLayout() {
|
| super.performLayout();
|
| size = constraints.constrain(new Size(constraints.maxWidth, childrenHeight));
|
| @@ -123,6 +131,7 @@ class RenderBlock extends RenderBlockBase {
|
| _hasVisualOverflow = childrenHeight > size.height;
|
| }
|
|
|
| + @override
|
| void paint(PaintingCanvas canvas, Offset offset) {
|
| if (_hasVisualOverflow) {
|
| canvas.save();
|
| @@ -174,18 +183,22 @@ class RenderBlockViewport extends RenderBlockBase {
|
| markNeedsPaint();
|
| }
|
|
|
| + @override
|
| double getMinIntrinsicWidth(BoxConstraints constraints) {
|
| return constraints.constrainWidth();
|
| }
|
|
|
| + @override
|
| double getMaxIntrinsicWidth(BoxConstraints constraints) {
|
| return constraints.constrainWidth();
|
| }
|
|
|
| + @override
|
| double getMinIntrinsicHeight(BoxConstraints constraints) {
|
| return constraints.constrainHeight();
|
| }
|
|
|
| + @override
|
| double getMaxIntrinsicHeight(BoxConstraints constraints) {
|
| return constraints.constrainHeight();
|
| }
|
| @@ -195,14 +208,18 @@ class RenderBlockViewport extends RenderBlockBase {
|
| // scroll the RenderBlockViewport, it would shift in its parent if
|
| // the parent was baseline-aligned, which makes no sense.
|
|
|
| + @override
|
| bool get sizedByParent => true;
|
|
|
| + @override
|
| void performResize() {
|
| size = constraints.biggest;
|
| assert(!size.isInfinite);
|
| }
|
|
|
| bool get debugDoesLayoutWithCallback => true;
|
| +
|
| + @override
|
| void performLayout() {
|
| if (_callback != null) {
|
| try {
|
| @@ -215,6 +232,7 @@ class RenderBlockViewport extends RenderBlockBase {
|
| super.performLayout();
|
| }
|
|
|
| + @override
|
| void paint(PaintingCanvas canvas, Offset offset) {
|
| canvas.save();
|
| canvas.clipRect(offset & size);
|
| @@ -222,6 +240,7 @@ class RenderBlockViewport extends RenderBlockBase {
|
| canvas.restore();
|
| }
|
|
|
| + @override
|
| void hitTestChildren(HitTestResult result, { Point position }) {
|
| defaultHitTestChildren(result, position: position + new Offset(0.0, -startOffset));
|
| }
|
|
|