This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 84012 - LabelWidget boundary while zooming
Summary: LabelWidget boundary while zooming
Status: RESOLVED DUPLICATE of bug 98762
Alias: None
Product: platform
Classification: Unclassified
Component: Graph (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@platform
URL:
Keywords:
: 85696 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-01 13:00 UTC by David Kaspar
Modified: 2007-03-23 22:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Kaspar 2006-09-01 13:00:31 UTC
While a scene has a zoom factor different from 1.0, then the font boundaries
does not fit becuase of following condition:
zoomfactor * graphics.getFontMetric (new Font (fontHeight)).getWidth (label) !=
graphics.getFontMetric (new Font (fontHeight * zoomfactor)).getWidth (label)

Temporary workaround is to call
Widget.setCheckClipping (true);
It will remove the repaint problem, but the text may be cut.
Comment 1 David Kaspar 2006-09-25 17:58:57 UTC
*** Issue 85696 has been marked as a duplicate of this issue. ***
Comment 2 David Kaspar 2006-09-26 09:54:13 UTC
One way to make sure it always fits is to take as initial width :
rectangle.width = fontMetrics.charWidth('W') * label.length();

I know it is ugly but it works (even with strings that only contains spaces).
Comment 3 David Kaspar 2007-03-23 22:28:18 UTC
Setting as duplicate since it have the same reason and will be resolved the same
way.

*** This issue has been marked as a duplicate of 98762 ***