浏览代码

scroll bug fix (fix sign)

/main
xingwei.zhu 6 年前
当前提交
c6f932dc
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 4
      Runtime/ui/geometry.cs
  2. 2
      Runtime/widgets/scroll_activity.cs

4
Runtime/ui/geometry.cs


}
public static int sign(this float value) {
return (int) Mathf.Sign(value);
return value == 0.0f ? 0 : value > 0.0f ? 1 : -1;
}
public static bool isInfinite(this float it) {

if (other == null || other.isEmpty) {
return this;
}
return fromLTRB(
Mathf.Min(this.left, other.left),
Mathf.Min(this.top, other.top),

2
Runtime/widgets/scroll_activity.cs


this._lastDetails = details;
if (this._retainMomentum && velocity != 0.0f && velocity.sign() == this.carriedVelocity.Value.sign()) {
if (this._retainMomentum && velocity.sign() == this.carriedVelocity.Value.sign()) {
velocity += this.carriedVelocity.Value;
}

正在加载...
取消
保存