Commit d78b78c4 authored by Adam Barth's avatar Adam Barth

[rename fixit] scrollAnchor -> anchor

parent e9b8f445
......@@ -19,6 +19,7 @@ class RenderList extends RenderVirtualViewport<ListParentData> {
int virtualChildCount,
Offset paintOffset: Offset.zero,
Axis mainAxis: Axis.vertical,
ViewportAnchor anchor: ViewportAnchor.start,
Painter overlayPainter,
LayoutCallback callback
}) : _itemExtent = itemExtent,
......@@ -27,6 +28,7 @@ class RenderList extends RenderVirtualViewport<ListParentData> {
virtualChildCount: virtualChildCount,
paintOffset: paintOffset,
mainAxis: mainAxis,
anchor: anchor,
overlayPainter: overlayPainter,
callback: callback
) {
......
......@@ -85,11 +85,11 @@ class RenderViewportBase extends RenderBox implements HasMainAxis {
RenderViewportBase(
Offset paintOffset,
Axis mainAxis,
ViewportAnchor scrollAnchor,
ViewportAnchor anchor,
Painter overlayPainter
) : _paintOffset = paintOffset,
_mainAxis = mainAxis,
_scrollAnchor = scrollAnchor,
_anchor = anchor,
_overlayPainter = overlayPainter {
assert(paintOffset != null);
assert(mainAxis != null);
......@@ -139,13 +139,13 @@ class RenderViewportBase extends RenderBox implements HasMainAxis {
/// The end of the viewport from which the paint offset is computed.
///
/// See [ViewportAnchor] for more detail.
ViewportAnchor get scrollAnchor => _scrollAnchor;
ViewportAnchor _scrollAnchor;
void set scrollAnchor(ViewportAnchor value) {
ViewportAnchor get anchor => _anchor;
ViewportAnchor _anchor;
void set anchor(ViewportAnchor value) {
assert(value != null);
if (value == _scrollAnchor)
if (value == _anchor)
return;
_scrollAnchor = value;
_anchor = value;
markNeedsPaint();
markNeedsSemanticsUpdate();
}
......@@ -186,7 +186,7 @@ class RenderViewportBase extends RenderBox implements HasMainAxis {
int dyInDevicePixels = (_paintOffset.dy * devicePixelRatio).round();
return _dimensions.getAbsolutePaintOffset(
paintOffset: new Offset(dxInDevicePixels / devicePixelRatio, dyInDevicePixels / devicePixelRatio),
anchor: _scrollAnchor
anchor: _anchor
);
}
......@@ -199,7 +199,7 @@ class RenderViewportBase extends RenderBox implements HasMainAxis {
super.debugFillDescription(description);
description.add('paintOffset: $paintOffset');
description.add('mainAxis: $mainAxis');
description.add('scrollAnchor: $scrollAnchor');
description.add('anchor: $anchor');
if (overlayPainter != null)
description.add('overlay painter: $overlayPainter');
}
......@@ -219,10 +219,10 @@ class RenderViewport extends RenderViewportBase with RenderObjectWithChildMixin<
RenderBox child,
Offset paintOffset: Offset.zero,
Axis mainAxis: Axis.vertical,
ViewportAnchor scrollAnchor: ViewportAnchor.start,
ViewportAnchor anchor: ViewportAnchor.start,
Painter overlayPainter,
this.onPaintOffsetUpdateNeeded
}) : super(paintOffset, mainAxis, scrollAnchor, overlayPainter) {
}) : super(paintOffset, mainAxis, anchor, overlayPainter) {
this.child = child;
}
......@@ -339,11 +339,11 @@ abstract class RenderVirtualViewport<T extends ContainerBoxParentDataMixin<Rende
LayoutCallback callback,
Offset paintOffset: Offset.zero,
Axis mainAxis: Axis.vertical,
ViewportAnchor scrollAnchor: ViewportAnchor.start,
ViewportAnchor anchor: ViewportAnchor.start,
Painter overlayPainter
}) : _virtualChildCount = virtualChildCount,
_callback = callback,
super(paintOffset, mainAxis, scrollAnchor, overlayPainter);
super(paintOffset, mainAxis, anchor, overlayPainter);
int get virtualChildCount => _virtualChildCount;
int _virtualChildCount;
......
......@@ -833,7 +833,7 @@ class Viewport extends OneChildRenderObjectWidget {
Key key,
this.paintOffset: Offset.zero,
this.mainAxis: Axis.vertical,
this.scrollAnchor: ViewportAnchor.start,
this.anchor: ViewportAnchor.start,
this.overlayPainter,
this.onPaintOffsetUpdateNeeded,
Widget child
......@@ -854,7 +854,7 @@ class Viewport extends OneChildRenderObjectWidget {
/// that direction (e.g., the child can be as tall as it wants).
final Axis mainAxis;
final ViewportAnchor scrollAnchor;
final ViewportAnchor anchor;
/// Paints an overlay over the viewport.
///
......@@ -867,7 +867,7 @@ class Viewport extends OneChildRenderObjectWidget {
return new RenderViewport(
paintOffset: paintOffset,
mainAxis: mainAxis,
scrollAnchor: scrollAnchor,
anchor: anchor,
onPaintOffsetUpdateNeeded: onPaintOffsetUpdateNeeded,
overlayPainter: overlayPainter
);
......@@ -877,7 +877,7 @@ class Viewport extends OneChildRenderObjectWidget {
// Order dependency: RenderViewport validates scrollOffset based on mainAxis.
renderObject
..mainAxis = mainAxis
..scrollAnchor = scrollAnchor
..anchor = anchor
..paintOffset = paintOffset
..onPaintOffsetUpdateNeeded = onPaintOffsetUpdateNeeded
..overlayPainter = overlayPainter;
......
......@@ -166,7 +166,7 @@ class PageableListState<T extends PageableList> extends ScrollableState<T> {
return new PageViewport(
itemsWrap: config.itemsWrap,
mainAxis: config.scrollDirection,
scrollAnchor: config.scrollAnchor,
anchor: config.scrollAnchor,
startOffset: scrollOffset,
overlayPainter: config.scrollableListPainter,
children: config.children
......@@ -227,7 +227,7 @@ class PageViewport extends VirtualViewportFromIterable {
PageViewport({
this.startOffset: 0.0,
this.mainAxis: Axis.vertical,
this.scrollAnchor: ViewportAnchor.start,
this.anchor: ViewportAnchor.start,
this.itemsWrap: false,
this.overlayPainter,
this.children
......@@ -237,7 +237,7 @@ class PageViewport extends VirtualViewportFromIterable {
final double startOffset;
final Axis mainAxis;
final ViewportAnchor scrollAnchor;
final ViewportAnchor anchor;
final bool itemsWrap;
final Painter overlayPainter;
final Iterable<Widget> children;
......@@ -326,7 +326,7 @@ class _PageViewportElement extends VirtualViewportElement {
_materializedChildCount = limitItem - startItem;
_startOffsetBase = startItem.toDouble();
_startOffsetLimit = (limitItem - 1).toDouble();
if (widget.scrollAnchor == ViewportAnchor.end)
if (widget.anchor == ViewportAnchor.end)
_materializedChildBase = (length - _materializedChildBase - _materializedChildCount) % length;
}
......
......@@ -658,7 +658,7 @@ class _ScrollableViewportState extends ScrollableState<ScrollableViewport> {
return new Viewport(
paintOffset: scrollOffsetToPixelDelta(scrollOffset),
mainAxis: config.scrollDirection,
scrollAnchor: config.scrollAnchor,
anchor: config.scrollAnchor,
onPaintOffsetUpdateNeeded: _handlePaintOffsetUpdateNeeded,
child: config.child
);
......
......@@ -79,7 +79,7 @@ class _ScrollableListState extends ScrollableState<ScrollableList> {
onExtentsChanged: _handleExtentsChanged,
scrollOffset: scrollOffset,
mainAxis: config.scrollDirection,
scrollAnchor: config.scrollAnchor,
anchor: config.scrollAnchor,
itemExtent: config.itemExtent,
itemsWrap: config.itemsWrap,
padding: config.padding,
......@@ -94,7 +94,7 @@ class _VirtualListViewport extends VirtualViewport {
this.onExtentsChanged,
this.scrollOffset,
this.mainAxis,
this.scrollAnchor,
this.anchor,
this.itemExtent,
this.itemsWrap,
this.padding,
......@@ -107,7 +107,7 @@ class _VirtualListViewport extends VirtualViewport {
final ExtentsChangedCallback onExtentsChanged;
final double scrollOffset;
final Axis mainAxis;
final ViewportAnchor scrollAnchor;
final ViewportAnchor anchor;
final double itemExtent;
final bool itemsWrap;
final EdgeDims padding;
......@@ -116,7 +116,7 @@ class _VirtualListViewport extends VirtualViewport {
double get _leadingPadding {
switch (mainAxis) {
case Axis.vertical:
switch (scrollAnchor) {
switch (anchor) {
case ViewportAnchor.start:
return padding.top;
case ViewportAnchor.end:
......@@ -124,7 +124,7 @@ class _VirtualListViewport extends VirtualViewport {
}
break;
case Axis.horizontal:
switch (scrollAnchor) {
switch (anchor) {
case ViewportAnchor.start:
return padding.left;
case ViewportAnchor.end:
......@@ -167,7 +167,7 @@ class _VirtualListViewportElement extends VirtualViewportElement {
void updateRenderObject(_VirtualListViewport oldWidget) {
renderObject
..mainAxis = widget.mainAxis
..scrollAnchor = widget.scrollAnchor
..anchor = widget.anchor
..itemExtent = widget.itemExtent
..padding = widget.padding
..overlayPainter = widget.overlayPainter;
......@@ -217,7 +217,7 @@ class _VirtualListViewportElement extends VirtualViewportElement {
_startOffsetBase = startItem * itemExtent;
_startOffsetLimit = limitItem * itemExtent - containerExtent;
if (widget.scrollAnchor == ViewportAnchor.end)
if (widget.anchor == ViewportAnchor.end)
_materializedChildBase = (length - _materializedChildBase - _materializedChildCount) % length;
}
......@@ -247,7 +247,7 @@ class ListViewport extends _VirtualListViewport with VirtualViewportFromIterable
ExtentsChangedCallback onExtentsChanged,
double scrollOffset: 0.0,
Axis mainAxis: Axis.vertical,
ViewportAnchor scrollAnchor: ViewportAnchor.start,
ViewportAnchor anchor: ViewportAnchor.start,
double itemExtent,
bool itemsWrap: false,
EdgeDims padding,
......@@ -257,7 +257,7 @@ class ListViewport extends _VirtualListViewport with VirtualViewportFromIterable
onExtentsChanged,
scrollOffset,
mainAxis,
scrollAnchor,
anchor,
itemExtent,
itemsWrap,
padding,
......@@ -342,7 +342,7 @@ class _ScrollableLazyListState extends ScrollableState<ScrollableLazyList> {
onExtentsChanged: _handleExtentsChanged,
scrollOffset: scrollOffset,
mainAxis: config.scrollDirection,
scrollAnchor: config.scrollAnchor,
anchor: config.scrollAnchor,
itemExtent: config.itemExtent,
itemCount: config.itemCount,
itemBuilder: config.itemBuilder,
......@@ -357,7 +357,7 @@ class LazyListViewport extends _VirtualListViewport with VirtualViewportFromBuil
ExtentsChangedCallback onExtentsChanged,
double scrollOffset: 0.0,
Axis mainAxis: Axis.vertical,
ViewportAnchor scrollAnchor: ViewportAnchor.start,
ViewportAnchor anchor: ViewportAnchor.start,
double itemExtent,
EdgeDims padding,
Painter overlayPainter,
......@@ -367,7 +367,7 @@ class LazyListViewport extends _VirtualListViewport with VirtualViewportFromBuil
onExtentsChanged,
scrollOffset,
mainAxis,
scrollAnchor,
anchor,
itemExtent,
false, // Don't support wrapping yet.
padding,
......
......@@ -51,7 +51,7 @@ abstract class VirtualViewportElement extends RenderObjectElement {
/// Returns the pixel offset for a scroll offset, accounting for the scroll
/// anchor.
double scrollOffsetToPixelOffset(double scrollOffset) {
switch (renderObject.scrollAnchor) {
switch (renderObject.anchor) {
case ViewportAnchor.start:
return -scrollOffset;
case ViewportAnchor.end:
......
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