gewentao 6 年前
当前提交
9fac3eb7
共有 1 个文件被更改,包括 58 次插入58 次删除
  1. 116
      Assets/UIWidgets/painting/alignment.cs

116
Assets/UIWidgets/painting/alignment.cs


{
return !(a == b);
}
}
public class _MixedAlignment : IEquatable<_MixedAlignment>
public class _MixedAlignment : IEquatable<_MixedAlignment>
{
public _MixedAlignment(double x, double start, double y)
public _MixedAlignment(double x, double start, double y)
{
this.x = x;
this.start = start;
this.y = y;
}
this.x = x;
this.start = start;
this.y = y;
}
private readonly double x;
private readonly double x;
private readonly double start;
private readonly double start;
private readonly double y;
private readonly double y;
public static _MixedAlignment operator -(_MixedAlignment a)
{
return new _MixedAlignment(
-a.x,
-a.start,
-a.y
);
}
public static _MixedAlignment operator -(_MixedAlignment a)
{
return new _MixedAlignment(
-a.x,
-a.start,
-a.y
);
}
public static _MixedAlignment operator *(_MixedAlignment a, double other)
{
return new _MixedAlignment(
a.x * other,
a.start * other,
a.y * other
);
}
public static _MixedAlignment operator *(_MixedAlignment a, double other)
{
return new _MixedAlignment(
a.x * other,
a.start * other,
a.y * other
);
}
public static _MixedAlignment operator /(_MixedAlignment a, double other)
{
return new _MixedAlignment(
a.x / other,
a.start / other,
a.y / other
);
}
public static _MixedAlignment operator /(_MixedAlignment a, double other)
{
return new _MixedAlignment(
a.x / other,
a.start / other,
a.y / other
);
}
public static _MixedAlignment operator %(_MixedAlignment a, double other)
{
return new _MixedAlignment(
a.x % other,
a.start % other,
a.y % other
);
}
public static _MixedAlignment operator %(_MixedAlignment a, double other)
{
return new _MixedAlignment(
a.x % other,
a.start % other,
a.y % other
);
}
public Alignment resolve(TextDirection direction)
public Alignment resolve(TextDirection direction)
{
switch (direction)
switch (direction)
{
case TextDirection.rtl:
return new Alignment(x - start, y);
case TextDirection.ltr:
return new Alignment(x + start, y);
}
case TextDirection.rtl:
return new Alignment(x - start, y);
case TextDirection.ltr:
return new Alignment(x + start, y);
}
return null;
}
return null;
}
public bool Equals(_MixedAlignment other)
{
if (object.ReferenceEquals(null, other)) return false;
if (object.ReferenceEquals(this, other)) return true;
return this.x.Equals(other.x) && this.y.Equals(other.y) && this.start.Equals(other.start);
}
public bool Equals(_MixedAlignment other)
{
if (object.ReferenceEquals(null, other)) return false;
if (object.ReferenceEquals(this, other)) return true;
return this.x.Equals(other.x) && this.y.Equals(other.y) && this.start.Equals(other.start);
}
}
}
正在加载...
取消
保存