From f4ec425bf0981c5597f4f8cd711e1bf63b00307b Mon Sep 17 00:00:00 2001 From: BobLd Date: Wed, 15 May 2019 19:44:47 +0100 Subject: [PATCH] - Correction of the PdfLine's length formula; - Moving Line to TextLine --- src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs | 2 +- src/UglyToad.PdfPig/Content/{Line.cs => TextLine.cs} | 0 src/UglyToad.PdfPig/Geometry/PdfLine.cs | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) rename src/UglyToad.PdfPig/Content/{Line.cs => TextLine.cs} (100%) diff --git a/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs b/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs index 3d3fd255..662780b3 100644 --- a/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs +++ b/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs @@ -45,7 +45,7 @@ "UglyToad.PdfPig.Content.Page", "UglyToad.PdfPig.Content.PageSize", "UglyToad.PdfPig.Content.Word", - "UglyToad.PdfPig.Content.Line", + "UglyToad.PdfPig.Content.TextLine", "UglyToad.PdfPig.Content.TextDirection", "UglyToad.PdfPig.Core.TransformationMatrix", "UglyToad.PdfPig.CrossReference.CrossReferenceTable", diff --git a/src/UglyToad.PdfPig/Content/Line.cs b/src/UglyToad.PdfPig/Content/TextLine.cs similarity index 100% rename from src/UglyToad.PdfPig/Content/Line.cs rename to src/UglyToad.PdfPig/Content/TextLine.cs diff --git a/src/UglyToad.PdfPig/Geometry/PdfLine.cs b/src/UglyToad.PdfPig/Geometry/PdfLine.cs index 0b8bdb6f..4903db44 100644 --- a/src/UglyToad.PdfPig/Geometry/PdfLine.cs +++ b/src/UglyToad.PdfPig/Geometry/PdfLine.cs @@ -17,7 +17,8 @@ { get { - decimal l = (Point1.X - Point1.X) * (Point1.X - Point1.X) + (Point1.Y - Point1.Y) * (Point1.Y - Point1.Y); + decimal l = (Point1.X - Point2.X) * (Point1.X - Point2.X) + + (Point1.Y - Point2.Y) * (Point1.Y - Point2.Y); return (decimal)System.Math.Sqrt((double)l); } }