Menu

#2238 ScintillaView uses an outdated drawing rectangle after view is resized

Bug
closed-fixed
nobody
5
2021-04-09
2021-03-08
No

This is an issue only with the cocoa version of scintilla.
OS: MacOS Catalina 10.15.4

To reproduce the issue I used the ScintillaTest project (I used 446 for testing since I couldn't build ScintillaTest in 500), where I disabled the horizontal scrollbar by inserting the following line in setupEditor:

[mEditor setGeneralProperty: SCI_SETHSCROLLBAR parameter: 0 value: 0];

After that:
1. Clear the initial text in the window;
2. Write some random text in one line;
3. Shrink the window horizontally (and release the mouse button after that);
4. Expand the window horizontally;
5. Change the text in the beginning of the line (insert new characters or delete existing ones).

You can see that scintilla doesn't draw the contents in the new space that was created after expanding the window.

I'll attach a video that shows the issue.

1 Attachments

Discussion

  • Petko Georgiev

    Petko Georgiev - 2021-03-08

    I was able to get it working with the attached change

     
  • Neil Hodgson

    Neil Hodgson - 2021-03-10

    It appears to work if the patch is simplified down to

    diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm
    --- a/cocoa/ScintillaView.mm
    +++ b/cocoa/ScintillaView.mm
    @@ -263,6 +263,8 @@
        super.frame = frame;
    
        mOwner.backend->Resize();
    +
    +   [super prepareContentInRect: [self visibleRect]];
     }
    
     //--------------------------------------------------------------------------------------------------
    

    That avoids a call to mOwner.backend->WillDraw(rect); which is fairly heavy.

     
  • Neil Hodgson

    Neil Hodgson - 2021-04-02
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2021-04-02

    Committed minimal fix as [2c0fcb].

     

    Related

    Commit: [2c0fcb]

  • Neil Hodgson

    Neil Hodgson - 2021-04-09
    • status: open-fixed --> closed-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2021-04-09

    Committed minimal fix as [2c0fcb].

     

    Related

    Commit: [2c0fcb]


Log in to post a comment.