Menu

#625 TCoolEdit does not refresh the window properly

8
pending
1
2025-08-29
2025-08-13
No

In some cases when scrolling, the window refresh is only partial.

  1. Arrange the editor window so that you have a line longer than the width of the window at the bottom the window, followed by an empty line, just out of view.
  2. Put the cursor at the end of the long line, making sure it stays at the bottom of the window, with the next line out of view.
  3. Now press Arrow Down to move to the empty line.

Note that after step 2, the view scrolls to the right to show the end of the long line and the window is properly refreshed. After step 3, the view scrolls down and left to show the cursor at the start of the short line, but the left part of the window above the long line is not refreshed:

TCoolEdit refresh bug screenshot

PS. The title of this ticket is intentionally vague to encompass any other refresh issues that TCoolEdit may have. Please report any such issues in the comment section.

1 Attachments

Related

Wiki: OWLNext_Roadmap_and_Prereleases

Discussion

  • Vidar Hasfjord

    Vidar Hasfjord - 2025-08-13

    A similar issue occurs when scrolling up and left from the end of a long line:

    1. Arrange the editor window so that you have a line longer than the width of the window at the top the window, preceded by an empty line, just out of view.
    2. Put the cursor at the end of the long line, making sure it stays at the top of the window, with the preceding line out of view.
    3. Now press Arrow Up to move to the empty line.

    Note that after step 2, the view scrolls to the right to show the end of the long line and the window is properly refreshed. After step 3, the view scrolls up and left to show the cursor at the start of the short line, but the left part of the window below the long line is not refreshed.

     
  • Erwin Lotter

    Erwin Lotter - 2025-08-13

    Note that after step 2, the view scrolls to the right to show the end of the long line and the window is properly refreshed. After step 3, the view scrolls down and left to show the cursor at the start of the short line, but the left part of the window above the long line is not refreshed

    When making the HScroll step bigger, one can see that also the left part of the window above the long line is refreshed, but it is (still) overlayed by a shifted part of the margin.
    I guess that the redraw-rect includes the margin width only once instead of twice.

     
  • Vidar Hasfjord

    Vidar Hasfjord - 2025-08-13

    @elotter wrote:

    one can see that also the left part of the window above the long line is refreshed

    The old content is correctly scrolled to the right it seems (by ScrollWindow, I guess?), but the uncovered content (the part to the left that wasn't visible before) isn't refreshed, and neither is the margin. It also seems that the scroll and clip areas are not set correctly; they include the margin area, which should be excluded.

    Feel free to take ownership of this ticket.

    Edit: Too late. I've taken ownership. :-)

    The problem was indeed with ScrollWindow (within TCoolScroller::ScrollTo).

    PS. By the way, have you noticed that when using touch/pad to scroll the window horizontally the direction is reversed from normal conventions? Odd.

     

    Last edit: Vidar Hasfjord 2025-08-14
  • Vidar Hasfjord

    Vidar Hasfjord - 2025-08-14
    • status: open --> pending
    • assigned_to: Vidar Hasfjord
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2025-08-14

    The refresh issue when the window was scrolled both horizontally and vertically at the same time has now been fixed [r8322]. Please test and review. And report any other refresh issues here, as well.

     

    Related

    Commit: [r8322]

  • Vidar Hasfjord

    Vidar Hasfjord - 2025-08-14
    • Group: unspecified --> 8
     
  • Erwin Lotter

    Erwin Lotter - 2025-08-15

    Please test and review. And report any other refresh issues here, as well.

    I transfered your fix to branches/7-coolprj-dev ([r8327]). Works well.

    ...when using touch/pad to scroll the window horizontally the direction is reversed from normal conventions

    The same on my notebook. But there seems to be no code and no setting to influence this. And the mouse wheel doesn't support horizontal scrolling at all.

     
    👍
    1

    Related

    Commit: [r8327]

  • Vidar Hasfjord

    Vidar Hasfjord - 2025-08-29
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -6,6 +6,6 @@
    
     Note that after step 2, the view scrolls to the right to show the end of the long line and the window is properly refreshed. After step 3, the view scrolls down and left to show the cursor at the start of the short line, but the left part of the window above the long line is *not* refreshed:
    
    -<img alt="TCoolEdit refresh bug screenshot" src="625/attachment/TCoolEdit-refresh-bug.png" width="100%" />
    +<img alt="TCoolEdit refresh bug screenshot" src="attachment/TCoolEdit-refresh-bug.png" width="100%" />
    
     PS. The title of this ticket is intentionally vague to encompass any other refresh issues that TCoolEdit may have. Please report any such issues in the comment section.
    
     

Log in to post a comment.