Skip to content

Commit 3e02529

Browse files
committed
Translate image based on /Rotate.
1 parent c918cbf commit 3e02529

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PdfSharpCore/Pdf.Advanced/PdfFormXObject.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ internal PdfFormXObject(PdfDocument thisDocument, PdfImportedObjectTable importe
212212

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

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

0 commit comments

Comments
 (0)