How to rotate a figure [message #221820] |
Mon, 21 August 2006 09:14 |
Eclipse User |
|
|
|
Originally posted by: geetesh.jain.gmail.com
Hi all,
I can succesful draw a figure on the editor.. and subsequent childs also
over it.
However now i have to add a feature where in i can rotate the parent
figure, and subsequent child should get rotated with it.
So please suggest a solution to how to achieve this objective.
Thanks
Gunakar Rao
|
|
|
Re: How to rotate a figure [message #221893 is a reply to message #221820] |
Mon, 21 August 2006 14:46 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
This is probably possible to do, but it is not supported right now.
The main issue is the way a figure is clipped to a bounding rectangle. Once
you start rotating the rectangle, there is no support in SWT for
intersecting such geometry, so the clip "region" or "path" can not be
computed easily. You could decide in your application that your figures are
well-behaved and will not paint outside of their bounds, so you don't need
to calculate the intersection. Or, you could use AWT geometry package to do
the math. But either way, you have some work to do. Most notably, once you
call rotate() on SWTGraphics, you can no longer call clip(), it will throw
an exception.
"Gunakar Rao" <geetesh.jain@gmail.com> wrote in message
news:92093fd073702afe651a7da843ee65b0$1@www.eclipse.org...
> Hi all,
>
> I can succesful draw a figure on the editor.. and subsequent childs also
> over it.
> However now i have to add a feature where in i can rotate the parent
> figure, and subsequent child should get rotated with it.
>
> So please suggest a solution to how to achieve this objective.
>
> Thanks
> Gunakar Rao
>
>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02869 seconds