Posted by qu0ll
on September 8, 2008 at 9:05 PM PDT
If I draw a rectangle in the center of a panel at say (x, y) and then I draw it again after appying a scale of (sx, sy), how do I get it so that the center of the rectangle at both scale levels is in the same location on the screen, i.e. (x, y)? It looks like I need to apply a translate transform (dx, dy) as well but what would the dx and dy be in this case?
Also, is there some way to determine the *scaled* attributes of the rectangle after the scale has been applied? Obviously rect.x and rect.width are not going to change so what I want is the actual location of the rectangle's x and the actual width of the rectangle as it appears on the screen after the scaling has been applied.
And loving it,
-Qu0ll (Rare, not extinct)
[Replace the "SixFour" with numbers to email me]