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>
|
/// <summary>
|
||||||
/// Area of the rectangle.
|
/// Area of the rectangle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Area => Width * Height;
|
public double Area { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Left.
|
/// Left.
|
||||||
@@ -128,6 +128,7 @@ namespace UglyToad.PdfPig.Core
|
|||||||
Rotation = Math.Round(t * 180.0 / Math.PI, 5);
|
Rotation = Math.Round(t * 180.0 / Math.PI, 5);
|
||||||
Width = Math.Round(cosSqSinSqInv * (bx * cosT - by * sinT), 5);
|
Width = Math.Round(cosSqSinSqInv * (bx * cosT - by * sinT), 5);
|
||||||
Height = Math.Round(cosSqSinSqInv * (-bx * sinT + by * cosT), 5);
|
Height = Math.Round(cosSqSinSqInv * (-bx * sinT + by * cosT), 5);
|
||||||
|
Area = Width * Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@@ -196,7 +196,7 @@
|
|||||||
minY = letter.EndBaseLine.Y;
|
minY = letter.EndBaseLine.Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
var right = letter.StartBaseLine.X - letter.GlyphRectangle.Width;
|
var right = letter.StartBaseLine.X + letter.GlyphRectangle.Height;
|
||||||
if (right > maxX)
|
if (right > maxX)
|
||||||
{
|
{
|
||||||
maxX = right;
|
maxX = right;
|
||||||
@@ -238,7 +238,7 @@
|
|||||||
minY = letter.StartBaseLine.Y;
|
minY = letter.StartBaseLine.Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
var right = letter.StartBaseLine.X - letter.GlyphRectangle.Width;
|
var right = letter.StartBaseLine.X - letter.GlyphRectangle.Height;
|
||||||
if (right < minX)
|
if (right < minX)
|
||||||
{
|
{
|
||||||
minX = right;
|
minX = right;
|
||||||
|
Reference in New Issue
Block a user