Skip to content

disappearing horizontal scrollbar in Editor #355

Closed

Description

@processing-bugs

Original author: Adam.Sch...@gmail.com (July 15, 2010 19:29:41)

Windows 7 64bit
Scrollbar disappears on long strings in the editor eg.
1.type something long no enters or spaces like ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
2. scroll as far as you can let go scrollbar disappears

Original issue: http://code.google.com/p/processing/issues/detail?id=316

Activity

  1. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From f...@processing.org on July 15, 2010 19:30:52
    is this with 1.2.1?

  2. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From Adam.Sch...@gmail.com on July 15, 2010 19:34:11
    1.2

  3. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From Adam.Sch...@gmail.com on July 15, 2010 19:36:00
    just tried 1.2.1 yup

  4. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From f...@processing.org on July 16, 2010 11:20:03
    Nuts, hadn't seen that one for a while, so we had closed up the bug. But this description at least gives me something to test against. Thanks.

  5. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From mkmori...@gmail.com on August 16, 2010 17:36:55
    Related strangeness:

    If cursor is off-screen (left side) when the horizontal scroll bar disappears, arrowing down causes cursor to stay on first visible position on left until reaching a line that is entirely off-screen, (which restores the scroll bar).

    It's not always necessary to move scroll bar all the way to the right before it disappears.

    Sometimes, instead of disappearing, scroll bar grows when it is dropped, filling the scroll area. Scroll bar consistently disappears when it reaches the right side.

    FWIW! (1.2.1, WinXP)

  6. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From peregue...@gmail.com on October 04, 2010 11:33:31
    I can confirm I have the same issues with 1.2.1 and MAC OS 10.5

  7. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From Chris.Lonnen on October 15, 2010 18:50:35
    Strangely, I cannot reproduce this on OSX 10.6.4

  8. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From f...@processing.org on October 15, 2010 19:06:05
    Use the line from comment #1, and put the caret at the end of the line and it'll disappear (until you move the caret to about the middle of the line).

  9. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From Chris.Lonnen on October 15, 2010 19:26:46
    I had to update from 0186 to 1.2.1, but I can confirm it on OSX 10.6.4 and I'm looking into it now.

  10. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From Chris.Lonnen on October 18, 2010 15:52:43
    The scroll bar issue occurs because of bad values set through horizontal.setValues(), which was added to JEditTextArea in order to fix bug 280. When the ((newValue + newExtent) > newMax) the BoundedRangeModel inside the JScrollBar tries to coerce the values to obey "minimum <= value <= value+extent <= maximum", which appears to be causing the problem. I'm working out a fix now.

  11. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From f...@processing.org on October 18, 2010 16:00:59
    Right, so that'll be part of it. It still disappears even without the issue 280 regression, though it's tougher to reproduce, see issue 10.

  12. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From Chris.Lonnen on October 18, 2010 16:51:00
    Looking at Christian's old fix I've worked out:
    //setValues(int newValue, int newExtent, int newMin, int newMax)
    horizontal.setValues(-horizontalOffset, painterWidth, -charWidth, width + charWidth);

    Which fixes the both the disappearing left hand gutter and the the disappearing scroll bar for me. The use of charWidth could be replaced with a separate gutterWidth variable; I'm using it here because it produces a gutter that scales with font changes.

    The visibility of the scroll bar is never explicitly modified, and the updateScrollBars() method contains the only change to values of the horizontal scroll bar, so it would follow that the intermittent issue 10 is also caused by values being passed there. We could throw in an if statement to catch strange values and print a better error or write our own scaling to make sure that no strange values are passed.

  13. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From m...@christian-thiemann.de on October 18, 2010 18:55:54
    One minor comment on this:

    In processing.app.Editor, line 184 reads: textarea.setHorizontalOffset(6);

    The 6 here is the reason why I had two 6's in my comment on issue 280 – it's the initial left-hand gutter width, so it should also be updated to charWidth (or gutterWidth) as well.

  14. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From Chris.Lonnen on October 20, 2010 17:13:07
    Thanks. I think we should introduce a static field into processing.app.syntax.JEditTextArea, something like 'public static final int leftHandGutter = 6;' Then change line 184 in Editor to textarea.setHorizontalOffset(JEditTextArea.leftHandGutter);

    The issue at hand can be fixed by replacing line 302 with the following:

    if ( (-horizontalOffset) > 0 ){
    horizontal.setValues(-horizontalOffset, painterWidth, -leftHandGutter, width);
    } else {
    horizontal.setValues(-leftHandGutter, painterWidth, -leftHandGutter, width);
    }

    which will correctly update the horizontal bars when scrolling. The if() statement alters the values to re-establish the gutter if the window is positioned at the begging of the lines. Without the if() statement, the true block alone will put space in the scroll bar, and it will be revealed by manipulating the bar, but moving the cursor alone will position the starting char of the line as if there was no gutter.

  15. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From f...@processing.org on October 20, 2010 20:47:58
    Yes, this looks good, thanks. Please check it in.

  16. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From Chris.Lonnen on October 20, 2010 21:40:09
    Fixed in revision 7397.

  17. github-actions commented on Jun 18, 2021

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  18. locked as resolved and limited conversation to collaborators on Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    highimported

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions