浏览代码

Merge pull request #246 from Unity-Technologies/fix_alignment_issue

fix stackoverflow
/main
GitHub 3 年前
当前提交
93cf0132
共有 2 个文件被更改,包括 7 次插入7 次删除
  1. 12
      com.unity.uiwidgets/Runtime/painting/alignment.cs
  2. 2
      com.unity.uiwidgets/Runtime/rendering/tweens.cs

12
com.unity.uiwidgets/Runtime/painting/alignment.cs


return b * t;
if (b == null)
return a * (1.0f - t);
if (a is Alignment && b is Alignment)
return Alignment.lerp(a, b, t);
if (a is AlignmentDirectional && b is AlignmentDirectional)
return AlignmentDirectional.lerp(a, b, t);
if (a is Alignment _a && b is Alignment _b)
return Alignment.lerpAlignment(_a, _b, t);
if (a is AlignmentDirectional _ad && b is AlignmentDirectional _bd)
return AlignmentDirectional.lerpAlignmentDirectional(_ad, _bd, t);
return new _MixedAlignment(
MathUtils.lerpNullableFloat(a._x, b._x, t),
MathUtils.lerpNullableFloat(a._start, b._start, t),

);
}
public static Alignment lerp(Alignment a, Alignment b, float t) {
public static Alignment lerpAlignment(Alignment a, Alignment b, float t) {
if (a == null && b == null) {
return null;
}

return new AlignmentDirectional(start % other, y % other);
}
static AlignmentDirectional lerp(AlignmentDirectional a, AlignmentDirectional b, float t) {
public static AlignmentDirectional lerpAlignmentDirectional(AlignmentDirectional a, AlignmentDirectional b, float t) {
D.assert(t != null);
if (a == null && b == null)
return null;

2
com.unity.uiwidgets/Runtime/rendering/tweens.cs


}
public override Alignment lerp(float t) {
return Alignment.lerp(begin, end, t);
return Alignment.lerpAlignment(begin, end, t);
}
}
public class AlignmentGeometryTween : Tween<AlignmentGeometry> {

正在加载...
取消
保存