浏览代码

[1.5.4] Upgrade sliver.

/main
Yuncong Zhang 5 年前
当前提交
845f0388
共有 3 个文件被更改,包括 5 次插入3 次删除
  1. 3
      Runtime/rendering/sliver.cs
  2. 3
      Runtime/rendering/sliver_grid.cs
  3. 2
      Runtime/rendering/sliver_list.cs

3
Runtime/rendering/sliver.cs


public readonly bool hasVisualOverflow;
public readonly float? scrollOffsetCorrection;
public readonly float cacheExtent;
public const float precisionErrorTolerance = 1e-10f;
internal static string _debugCompareFloats(string labelA, float valueA, string labelB, float valueB) {
if (valueA.ToString("F1") != valueB.ToString("F1")) {

);
}
if (this.maxPaintExtent < this.paintExtent) {
if (this.paintExtent - this.maxPaintExtent > precisionErrorTolerance) {
verify(false,
"The \"maxPaintExtent\" is less than the \"paintExtent\".\n" +
_debugCompareFloats("maxPaintExtent", this.maxPaintExtent, "paintExtent",

3
Runtime/rendering/sliver_grid.cs


float _getOffsetFromStartInCrossAxis(float crossAxisStart) {
if (this.reverseCrossAxis == true) {
return (this.crossAxisCount * this.crossAxisStride - crossAxisStart - this.childCrossAxisExtent) ??
return (this.crossAxisCount * this.crossAxisStride - crossAxisStart - this.childCrossAxisExtent
- (this.crossAxisStride - this.childCrossAxisExtent)) ??
0.0f;
}

2
Runtime/rendering/sliver_list.cs


}
else {
float firstChildScrollOffset = earliestScrollOffset - this.paintExtentOf(this.firstChild);
if (firstChildScrollOffset < 0.0) {
if (firstChildScrollOffset < -SliverGeometry.precisionErrorTolerance) {
float correction = 0.0f;
while (earliestUsefulChild != null) {
D.assert(this.firstChild == earliestUsefulChild);

正在加载...
取消
保存