position/size of rectangle [message #117558] |
Fri, 13 February 2004 06:09  |
Eclipse User |
|
|
|
Originally posted by: nospam.gmx.net
Hello Guys!
Simple question:
i have little problem with a feedback rectangle, shown on add request.
the rectangle paints, but when i have a zoom level != 1.00
the rectangle paints in the position and in the size as if zoom level was
1.00.
feedback = new RectangleFigure();
Rectangle r = getHostFigure().getBounds().getCopy().getExpanded(5,5);
feedback.setBounds(r);
addFeedback(feedback);
So how do i use translateToAbsolute / translateToRelative to fix this?
Regards, Ingo
|
|
|
|
|
|
|
Re: position/size of rectangle [message #118372 is a reply to message #118236] |
Wed, 18 February 2004 14:47  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> Works fine now but only, when the feedback is added first,
Yes, if the feedback is not on the feedback layer, then it will not work.
What happens is both the primary and feedback layer are shifted upwards.
So, when you translate from the original figure, you are shifting the point
one way. When yo utranslate back to the feedback, it un-shifts the point.
> then the rectangle gets transleted and the bounds are set.
> The problem was, that at the time before the feedback is added,
> it has no parent and the rectangle can
|
|
|
Powered by
FUDForum. Page generated in 0.08449 seconds