Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Painter and transformations
Re: Painter and transformations [message #38854 is a reply to message #38852] |
Thu, 24 January 2013 10:06  |
mdelfede
Messages: 1310 Registered: September 2007
|
Ultimate Contributor |
|
|
Well, thanks to Mirek I got te point :
the last translation (used to center drawing on control) happens on a rotated reference, so it's wrong :
painter.Translate(-center);
painter.Rotate(angle);
painter.Translate(sz.cx / 2, sz.cy / 2); <--WRONG
The weird part is that matrix way worked because it is reversed too, as Mirek explained correctly; so, to achieve the purpose it's enough to reverse transformation order (explanation is quite complex, but it works) :
painter.Translate(sz.cx / 2, sz.cy / 2); <--WRONG
painter.Rotate(angle);
painter.Translate(-center);
This one does exactly what the matrix version do.
Max
|
|
|
Goto Forum:
Current Time: Thu Aug 28 10:44:07 CEST 2025
Total time taken to generate the page: 0.06919 seconds
|