mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-11-24 08:47:01 +08:00
Improving PdfPoint
This commit is contained in:
@@ -82,6 +82,39 @@
|
||||
return new PdfVector(X, Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts this <see cref="PdfPoint"/> into an array.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public double[] ToDouble()
|
||||
{
|
||||
return new double[] { (double)this.X, (double)this.Y };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether this <see cref="PdfPoint"/> is equal to a specified <see cref="PdfPoint"/> .
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is PdfPoint)
|
||||
{
|
||||
PdfPoint point = (PdfPoint)obj;
|
||||
return point.X == this.X && point.Y == this.Y;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the hash code for this <see cref="PdfPoint"/>.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (int)(this.X * 10_000 + 31 * this.Y * 10_000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a string representation of this point.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user