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 213999 - org.netbeans.editor.EditorUI.getLineheigth returns line heigth +1
Summary: org.netbeans.editor.EditorUI.getLineheigth returns line heigth +1
Status: RESOLVED DUPLICATE of bug 205707
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 7.1.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-11 16:43 UTC by gwaldon
Modified: 2012-06-14 08:02 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 gwaldon 2012-06-11 16:43:25 UTC
I draw my own GlyphGlutter and noticed since 7.1.2 each line of text is drawn 1 pixel further down than what it should be, created a increasing gap with text in the editor as we go down the component. 

Looking at the code, iteration for each line use EditorUI.getLineheigth; removing 1 pixel (EditorUI.getLineheigth()-1) solves the issue.

Finally using textUI.getYFromPos(view.getStartOffset()) as in 7.0.1 GlyphGutter code give also correct spacing.

This bug is reminiscent of issue 182810 but the value of 1 is independent of font size.
Comment 1 Miloslav Metelka 2012-06-14 08:02:18 UTC
The best way is to use the view hierarchy's methods (it properly handles possible line wrapping etc.) please see lines below GlyphGutter:525.
Unfortunately I did not succeed to finish a View API for NB 7.2 - issue #205707 so please use an implementation module dependency if possible.
I mark as dup of issue #205707 since it will be the only proper way for the future.

*** This bug has been marked as a duplicate of bug 205707 ***