Skip to content

Commit

Permalink
Translate image based on /Rotate.
Browse files Browse the repository at this point in the history
  • Loading branch information
noctis0430 committed Sep 27, 2023
1 parent c918cbf commit 3e02529
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PdfSharpCore/Pdf.Advanced/PdfFormXObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ internal PdfFormXObject(PdfDocument thisDocument, PdfImportedObjectTable importe

// Translate the image such that its center lies on the center of the rotated bounding box
double offset = (height - width) / 2;
if (height > width)
if (rotate == 90)
matrix.TranslatePrepend(offset, offset);
else
else if (rotate == -90)
matrix.TranslatePrepend(-offset, -offset);

//string item = "[" + PdfEncoders.ToString(matrix) + "]";
Expand Down

0 comments on commit 3e02529

Please sign in to comment.