fix: Fixes Point2D ctor (#1340)
This commit is contained in:
parent
f24c6a08dd
commit
65c196a8ae
7 changed files with 45 additions and 35 deletions
|
|
@ -41,16 +41,27 @@ public struct Point2D
|
|||
set => m_Y = value;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Point2D(IPoint2D p) : this(p.X, p.Y)
|
||||
{
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Point2D(Point3D p) : this(p.X, p.Y)
|
||||
{
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Point2D(Point2D p) : this(p.X, p.Y)
|
||||
{
|
||||
}
|
||||
|
||||
public Point2D(int x, int y)
|
||||
{
|
||||
m_X = x;
|
||||
m_Y = y;
|
||||
}
|
||||
|
||||
public Point2D(Point2D p) : this(p.X, p.Y)
|
||||
{
|
||||
}
|
||||
|
||||
public bool Equals(Point2D other) => m_X == other.m_X && m_Y == other.m_Y;
|
||||
|
||||
public bool Equals(IPoint2D other) => m_X == other?.X && m_Y == other.Y;
|
||||
|
|
|
|||
|
|
@ -54,10 +54,12 @@ public struct Point3D
|
|||
{
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Point3D(Point3D p) : this(p.X, p.Y, p.Z)
|
||||
{
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Point3D(Point2D p, int z) : this(p.X, p.Y, z)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue