ScaledGraphics & SWTGraphics Together for Rotation [message #163206] |
Thu, 29 November 2007 03:10 |
Eclipse User |
|
|
|
ScalableGraphics takes a graphics into its constructor and keeps it as a
member. I believe for the most part this graphics is an SWTGraphics, at
least in my use. In other words a ScalableGraphics also has an
SWTGraphics.
SWTGraphics supports rotation, ScalableGraphics does not. In order to
support rotation, I have created a derivative of ScalableGraphics
(ScaledGraphicsEx) which delegates rotate( float degrees ), drawText(
String s, int x, int y ), and drawString( String s, int x, int y ) to
either the SWTGraphics (which I hold as a member) or to the super
(depending on whether I need rotation or not).
Everything seems to work ok, except for zoom, when I zoom in on text that
has been rotated it looks wrong, either overprinted, or overlapped.
I seem to need to do something like zoomTextPoint in the ScaledGraphics
class. But when I implement my own zoomTextPoint in my ScaledGraphicsEx in
the drawString(String s, int x, int y) method I still do not get the
correct results.
Does anyone have any ideas?
By the way these funny effects are more predominate with multi-lined text,
something which I would like to have.
by the way as an aside there is a feature request for rotation in
ScaledGraphics here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=130419
You cannot seem vote on it, but I thought maybe someone might like to know.
thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.03017 seconds