Commit 79c3905e authored by Hixie's avatar Hixie

Cleanup around viewports

parent 8a2865ce
...@@ -195,6 +195,14 @@ class RenderViewportBase extends RenderBox implements HasScrollDirection { ...@@ -195,6 +195,14 @@ class RenderViewportBase extends RenderBox implements HasScrollDirection {
super.applyPaintTransform(child, transform.translate(effectivePaintOffset.dx, effectivePaintOffset.dy)); super.applyPaintTransform(child, transform.translate(effectivePaintOffset.dx, effectivePaintOffset.dy));
} }
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('paintOffset: $paintOffset');
description.add('scrollDirection: $scrollDirection');
description.add('scrollAnchor: $scrollAnchor');
if (overlayPainter != null)
description.add('overlay painter: $overlayPainter');
}
} }
typedef Offset ViewportDimensionsChangeCallback(ViewportDimensions dimensions); typedef Offset ViewportDimensionsChangeCallback(ViewportDimensions dimensions);
...@@ -373,4 +381,9 @@ abstract class RenderVirtualViewport<T extends ContainerBoxParentDataMixin<Rende ...@@ -373,4 +381,9 @@ abstract class RenderVirtualViewport<T extends ContainerBoxParentDataMixin<Rende
} }
Rect describeApproximatePaintClip(RenderObject child) => Point.origin & size; Rect describeApproximatePaintClip(RenderObject child) => Point.origin & size;
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('virtual child count: $virtualChildCount');
}
} }
...@@ -71,6 +71,7 @@ abstract class ExtentScrollBehavior extends ScrollBehavior<double, double> { ...@@ -71,6 +71,7 @@ abstract class ExtentScrollBehavior extends ScrollBehavior<double, double> {
double containerExtent, double containerExtent,
double scrollOffset: 0.0 double scrollOffset: 0.0
}) { }) {
assert(minScrollOffset <= maxScrollOffset);
if (contentExtent != null) if (contentExtent != null)
_contentExtent = contentExtent; _contentExtent = contentExtent;
if (containerExtent != null) if (containerExtent != null)
...@@ -109,8 +110,10 @@ class BoundedBehavior extends ExtentScrollBehavior { ...@@ -109,8 +110,10 @@ class BoundedBehavior extends ExtentScrollBehavior {
double minScrollOffset, double minScrollOffset,
double scrollOffset: 0.0 double scrollOffset: 0.0
}) { }) {
if (minScrollOffset != null) if (minScrollOffset != null) {
_minScrollOffset = minScrollOffset; _minScrollOffset = minScrollOffset;
assert(minScrollOffset <= maxScrollOffset);
}
return super.updateExtents( return super.updateExtents(
contentExtent: contentExtent, contentExtent: contentExtent,
containerExtent: containerExtent, containerExtent: containerExtent,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment