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

Summary: LabelWidget boundary while zooming
Product: platform Reporter: David Kaspar <dkaspar>
Component: GraphAssignee: issues@platform <issues>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

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 ***