mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-22 12:09:50 +08:00
Improving Geometry classes with Tests
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
namespace UglyToad.PdfPig.Geometry
|
||||
using System;
|
||||
|
||||
namespace UglyToad.PdfPig.Geometry
|
||||
{
|
||||
/// <summary>
|
||||
/// A line in a PDF file.
|
||||
@@ -53,6 +55,18 @@
|
||||
Point2 = point2;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The rectangle completely containing the <see cref="PdfLine"/>.
|
||||
/// </summary>
|
||||
public PdfRectangle GetBoundingRectangle()
|
||||
{
|
||||
return new PdfRectangle(
|
||||
Math.Min(this.Point1.X, this.Point2.X),
|
||||
Math.Min(this.Point1.Y, this.Point2.Y),
|
||||
Math.Max(this.Point1.X, this.Point2.X),
|
||||
Math.Max(this.Point1.Y, this.Point2.Y));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether this <see cref="PdfLine"/> is equal to a specified <see cref="PdfLine"/> .
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user