Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 213999 - org.netbeans.editor.EditorUI.getLineheigth returns line heigth +1
org.netbeans.editor.EditorUI.getLineheigth returns line heigth +1
Status: RESOLVED DUPLICATE of bug 205707
Product: editor
Classification: Unclassified
Component: Painting & Printing
7.1.2
PC Windows 7
: P3 (vote)
: 7.2
Assigned To: Miloslav Metelka
issues@editor
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-11 16:43 UTC by gwaldon
Modified: 2012-06-14 08:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo