PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

Difference result using ScaleTransform ver 1.32 vs 1.5
http://forum.pdfsharp.com/viewtopic.php?f=3&t=3974
Page 1 of 1

Author:  OlegTVO [ Thu May 30, 2019 8:21 am ]
Post subject:  Difference result using ScaleTransform ver 1.32 vs 1.5

Hi,
PdfGraphicsState.AddTransform using only XMatrixOrder.Prepend, so it has a different result when trying to run the code in 1.32 and 1.5 versions:

XFont fontRegular = new XFont("Times New Roman", 20, XFontStyle.Regular);

state = gfx.Save();
gfx.TranslateTransform(100, 100);
gfx.ScaleTransform(0.5, XMatrixOrder.Prepend);
gfx.DrawString("Test1", fontRegular, XBrushes.DarkSlateGray, 0, 30);
gfx.Restore(state);

state = gfx.Save();
gfx.TranslateTransform(200, 200);
gfx.ScaleTransform(0.5, 0.5, XMatrixOrder.Append); //<==== here we have got difference
gfx.DrawString("Test3", fontRegular, XBrushes.DarkSlateGray, 0, 30);
gfx.Restore(state);
state = gfx.Save();

Is there is a reason why append is not processed like it is done in provided example (AddTransform.png)

Attachments:
File comment: fixed AddTransform function
fixed AddTransform.png
fixed AddTransform.png [ 16.99 KiB | Viewed 94 times ]
File comment: Result ver:1.5
result ver.1.5.png
result ver.1.5.png [ 4.99 KiB | Viewed 94 times ]
File comment: Result ver:1.32
result ver.1.32.png
result ver.1.32.png [ 3.08 KiB | Viewed 94 times ]

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/