There doesn't seem to be any way to create a working TransformationGroup with angles close to zero.
I have found that angles 1-5 degrees on either side of the angles 0, 90, 180 and 270 degrees does not seem work.
Here is a test case that shows the odd behaviour. It creates three transformation groups and draws a rectangle and an ellipse in each of them. The groups with the angles 0 (black) and 10 (red) works, but the group with the angle 5 (blue) places it's content about 150 pixels to the right, rotated about 45 degrees and enlarged by about 30%.
---code---
Document doc;
Page page;
TransformationGroup grp;
doc = new Document();
page = new Page(PageSize.A4, 30f);
grp = new TransformationGroup(100, 100, 100, 200, 0);
grp.Add(new Circle(0, 0, 50, 100, null, RgbColor.Black, 0, null));
grp.Add(new Rectangle(-50, -100, 100, 200, RgbColor.Black, 1));
page.Elements.Add(grp);
grp = new TransformationGroup(100, 100, 100, 200, 5);
grp.Add(new Circle(0, 0, 50, 100, null, RgbColor.Blue, 0, null));
grp.Add(new Rectangle(-50, -100, 100, 200, RgbColor.Blue, 1));
page.Elements.Add(grp);
grp = new TransformationGroup(100, 100, 100, 200, 10);
grp.Add(new Circle(0, 0, 50, 100, null, RgbColor.Red, 0, null));
grp.Add(new Rectangle(-50, -100, 100, 200, RgbColor.Red, 1));
page.Elements.Add(grp);
doc.Pages.Add(page);
doc.Draw(@"c:\temp\test.pdf");
--- code ends ---
I also tried to create an unrotated group and setting the angle afterwards, but that gives the same result.
TransformationGroup bug?
Re: TransformationGroup bug?
Support · Apr 7, 2006Hello,
We were able to recreate the same behavior. It looks to be a bug that is introduced in v4.0. This has been forwarded over to the developers and we will get this issue resolved as soon as possible.
Thanks,
ceTe Software Support Team
Re: TransformationGroup bug?
Support · Apr 7, 2006Hello,
This issue was resolved and is available in v4.0.0 Build 60407 (and later) from our web site.
Thanks,
ceTe Software Support Team
Re: TransformationGroup bug?
Forum member · Apr 9, 2006Nice. :)
I donwloaded the new version, and it works.
Thanks.
/Göran Andersson