javalover520 / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

jSyntaxPane's ruler does not get properly resized #146

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a jsyntaxpane editor and add it to a scrollpane
2. Open/Insert code that exceeds the editor's height
3. Scroll to the bottom

What is the expected output? What do you see instead?
The last line should be aligned with the last line's number.
Instead, the last line number is moved a few pixels down.

What version of the product are you using? On what operating system?
jSyntaxPane: 0.9.4
OS: Ubuntu 10.04
Java: Hotspot 1.6.0_20

Please provide any additional information below.
I believe it is due to the border insets not taken into account in the 
updateSize() method of LineNumbersRuler class.

A way to solve this issue would be the following:

int fix = 0;
Border b = pane.getBorder();
if(b!=null){
   Insets insets = b.getBorderInsets(pane);
   if(insets!=null){
        fix = insets.bottom + insets.top + 2;
   }
}

int h = lineCount * charHeight + pane.getHeight()+fix;

Original issue reported on code.google.com by cyberpyt...@gmail.com on 8 Jun 2010 at 8:55

Attachments:

GoogleCodeExporter commented 8 years ago
Forgot to mention that in order to reproduce the bug you have to scroll down to 
the bottom AND CLICK inside the last line.

Original comment by cyberpyt...@gmail.com on 8 Jun 2010 at 8:57

GoogleCodeExporter commented 8 years ago
Thanks for the fix, but i'm afraid it's just a bit too late.
Line Numbers were recently re-implemented, and that issue does not occur with 
the latest builds.
Please get the latest svn and double check.  I did not have a chance to make a 
binary build of that.

Original comment by ayman.al...@gmail.com on 9 Jun 2010 at 3:50

GoogleCodeExporter commented 8 years ago
The latest line numbering code solves this.

Original comment by ayman.al...@gmail.com on 6 Jul 2010 at 6:13