fzhangtj 6 年前
当前提交
c779a895
共有 2 个文件被更改,包括 16 次插入5 次删除
  1. 15
      Runtime/widgets/page_view.cs
  2. 6
      Runtime/widgets/scroll_position.cs

15
Runtime/widgets/page_view.cs


return page * this.viewportDimension * this.viewportFraction;
}
public double page => this.getPageFromPixels(this.pixels.clamp(this.minScrollExtent, this.maxScrollExtent),
this.viewportDimension);
public double page {
get {
return this.getPageFromPixels(this.pixels.clamp(this.minScrollExtent, this.maxScrollExtent),
this.viewportDimension);
}
}
protected override void saveScrollOffset() {
PageStorage.of(this.context.storageContext)?.writeState(this.context.storageContext,

public override bool applyViewportDimension(double viewportDimension) {
double oldViewportDimensions = this.viewportDimension;
bool result = base.applyViewportDimension(viewportDimension);
double oldPixels = this.pixels;
double? oldPixels = null;
if (this.hasPixles) {
oldPixels = this.pixels;
}
: this.getPageFromPixels(oldPixels, oldViewportDimensions);
: this.getPageFromPixels(oldPixels.Value, oldViewportDimensions);
double newPixels = this.getPixelsFromPage(page);
if (newPixels != oldPixels) {
this.correctPixels(newPixels);

6
Runtime/widgets/scroll_position.cs


public override double pixels {
get {
//D.assert(this._pixels != null);
D.assert(this._pixels != null);
}
public bool hasPixles {
get { return this._pixels != null; }
}
internal double? _pixels;

正在加载...
取消
保存