This commit is contained in:
Xingwei Zhu 2021-08-30 14:15:28 +08:00
Родитель 4a1a372369
Коммит 643e982313
2 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -56,10 +56,10 @@ namespace Unity.UIWidgets.painting {
return b * t; return b * t;
if (b == null) if (b == null)
return a * (1.0f - t); return a * (1.0f - t);
if (a is Alignment && b is Alignment) if (a is Alignment _a && b is Alignment _b)
return Alignment.lerp(a, b, t); return Alignment.lerpAlignment(_a, _b, t);
if (a is AlignmentDirectional && b is AlignmentDirectional) if (a is AlignmentDirectional _ad && b is AlignmentDirectional _bd)
return AlignmentDirectional.lerp(a, b, t); return AlignmentDirectional.lerpAlignmentDirectional(_ad, _bd, t);
return new _MixedAlignment( return new _MixedAlignment(
MathUtils.lerpNullableFloat(a._x, b._x, t), MathUtils.lerpNullableFloat(a._x, b._x, t),
MathUtils.lerpNullableFloat(a._start, b._start, t), MathUtils.lerpNullableFloat(a._start, b._start, t),
@ -191,7 +191,7 @@ namespace Unity.UIWidgets.painting {
); );
} }
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) { if (a == null && b == null) {
return null; return null;
} }
@ -390,7 +390,7 @@ namespace Unity.UIWidgets.painting {
return new AlignmentDirectional(start % other, y % other); 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); D.assert(t != null);
if (a == null && b == null) if (a == null && b == null)
return null; return null;

Просмотреть файл

@ -21,7 +21,7 @@ namespace Unity.UIWidgets.rendering {
} }
public override Alignment lerp(float t) { public override Alignment lerp(float t) {
return Alignment.lerp(begin, end, t); return Alignment.lerpAlignment(begin, end, t);
} }
} }
public class AlignmentGeometryTween : Tween<AlignmentGeometry> { public class AlignmentGeometryTween : Tween<AlignmentGeometry> {