mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 19:54:52 +08:00
Fix issue with Width, Height and Area when the texxt orientation is not horizontal.
This commit is contained in:
@@ -33,17 +33,17 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Width of the rectangle.
|
/// Width of the rectangle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal Width { get; }
|
public decimal Width => Right - Left;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Height of the rectangle.
|
/// Height of the rectangle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal Height { get; }
|
public decimal Height => Top - Bottom;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Area of the rectangle.
|
/// Area of the rectangle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal Area { get; }
|
public decimal Area => Width * Height;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Left.
|
/// Left.
|
||||||
@@ -101,11 +101,6 @@
|
|||||||
|
|
||||||
BottomLeft = new PdfPoint(left, bottom);
|
BottomLeft = new PdfPoint(left, bottom);
|
||||||
BottomRight = new PdfPoint(right, bottom);
|
BottomRight = new PdfPoint(right, bottom);
|
||||||
|
|
||||||
Width = right - left;
|
|
||||||
Height = top - bottom;
|
|
||||||
|
|
||||||
Area = Width * Height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal PdfRectangle(PdfVector topLeft, PdfVector topRight, PdfVector bottomLeft, PdfVector bottomRight)
|
internal PdfRectangle(PdfVector topLeft, PdfVector topRight, PdfVector bottomLeft, PdfVector bottomRight)
|
||||||
@@ -115,11 +110,6 @@
|
|||||||
|
|
||||||
BottomLeft = bottomLeft.ToPoint();
|
BottomLeft = bottomLeft.ToPoint();
|
||||||
BottomRight = bottomRight.ToPoint();
|
BottomRight = bottomRight.ToPoint();
|
||||||
|
|
||||||
Width = bottomRight.Subtract(bottomLeft).GetMagnitude();
|
|
||||||
Height = topLeft.Subtract(bottomLeft).GetMagnitude();
|
|
||||||
|
|
||||||
Area = Width * Height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal PdfRectangle(PdfPoint topLeft, PdfPoint topRight, PdfPoint bottomLeft, PdfPoint bottomRight)
|
internal PdfRectangle(PdfPoint topLeft, PdfPoint topRight, PdfPoint bottomLeft, PdfPoint bottomRight)
|
||||||
@@ -129,11 +119,6 @@
|
|||||||
|
|
||||||
BottomLeft = bottomLeft;
|
BottomLeft = bottomLeft;
|
||||||
BottomRight = bottomRight;
|
BottomRight = bottomRight;
|
||||||
|
|
||||||
Width = bottomRight.X - bottomLeft.X;
|
|
||||||
Height = topLeft.Y - bottomLeft.Y;
|
|
||||||
|
|
||||||
Area = Width * Height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Reference in New Issue
Block a user