mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-19 02:37:56 +08:00
Update word bounding box computation
This commit is contained in:
@@ -55,7 +55,7 @@ namespace UglyToad.PdfPig.Core
|
||||
/// <summary>
|
||||
/// Area of the rectangle.
|
||||
/// </summary>
|
||||
public double Area => Width * Height;
|
||||
public double Area { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Left.
|
||||
@@ -128,6 +128,7 @@ namespace UglyToad.PdfPig.Core
|
||||
Rotation = Math.Round(t * 180.0 / Math.PI, 5);
|
||||
Width = Math.Round(cosSqSinSqInv * (bx * cosT - by * sinT), 5);
|
||||
Height = Math.Round(cosSqSinSqInv * (-bx * sinT + by * cosT), 5);
|
||||
Area = Width * Height;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -196,7 +196,7 @@
|
||||
minY = letter.EndBaseLine.Y;
|
||||
}
|
||||
|
||||
var right = letter.StartBaseLine.X - letter.GlyphRectangle.Width;
|
||||
var right = letter.StartBaseLine.X + letter.GlyphRectangle.Height;
|
||||
if (right > maxX)
|
||||
{
|
||||
maxX = right;
|
||||
@@ -238,7 +238,7 @@
|
||||
minY = letter.StartBaseLine.Y;
|
||||
}
|
||||
|
||||
var right = letter.StartBaseLine.X - letter.GlyphRectangle.Width;
|
||||
var right = letter.StartBaseLine.X - letter.GlyphRectangle.Height;
|
||||
if (right < minX)
|
||||
{
|
||||
minX = right;
|
||||
|
Reference in New Issue
Block a user