can't get Rulers to correctly show centimeters and inches [message #158519] |
Thu, 18 November 2004 12:41  |
Eclipse User |
|
|
|
When I call
RulerProvider.setUnits(RulerProvider.UNIT_CENTIMETERS) or
RulerProvider.setUnits(RulerProvider.UNIT_INCHES)
my horizontal and vertical rulers do not visually show Centimeters or
Inches. There is just a '0' on one end, and the rest of the ruler is
blank (white). UNIX_PIXELS works great. I added a RulerChangeListener,
and I know that notifyUnitsChanged() is being called with the new units
value. I have code identical to LogicRulerProvider in the logic
example. Why aren't my rulers rendering correctly?
Thanks.
- Sean
|
|
|
|
Re: can't get Rulers to correctly show centimeters and inches [message #159118 is a reply to message #158768] |
Mon, 22 November 2004 16:05  |
Eclipse User |
|
|
|
Creating new rulers and provider everytime can be expensive. You shouldn't
have to do that.
This problem is because of a bug in RulerEditPart. RulerEditPart sets the
interval to be 100 during creation of the RulerFigure if it detects that it
is displaying pixels. However, later when you change the units to say
inches, or centimeters, it's still displaying them, but will only make a
mark at every 100 inches or centimeters.
RulerEditPart shouldn't be setting the interval and the divisions. I've
been meaning to expose RulerFigure so that clients can customize it as
desired. Please open a bug request.
"Sean Neeley" <sean.neeley@dbcsoftware.com> wrote in message
news:cnlaam$e6k$1@www.eclipse.org...
> OK, looks like I can correctly switch back and forth from CENTIMETERS to
> INCHES to PIXELS if I create a new RulerProvider and new Rulers each
> time that I switch. Works great for now.
>
> - Sean
>
> Sean Neeley wrote:
> > When I call
> > RulerProvider.setUnits(RulerProvider.UNIT_CENTIMETERS) or
> > RulerProvider.setUnits(RulerProvider.UNIT_INCHES)
> > my horizontal and vertical rulers do not visually show Centimeters or
> > Inches. There is just a '0' on one end, and the rest of the ruler is
> > blank (white). UNIX_PIXELS works great. I added a RulerChangeListener,
> > and I know that notifyUnitsChanged() is being called with the new units
> > value. I have code identical to LogicRulerProvider in the logic
> > example. Why aren't my rulers rendering correctly?
> >
> > Thanks.
> > - Sean
|
|
|
Powered by
FUDForum. Page generated in 0.25536 seconds