User forums > Using Code::Blocks
Slow scrolling? [Ubuntu]
Alpha:
Bisected: revision 8278 introduces the problem. Something must have gone wrong with the Scintilla update.
Jenna:
So we should not touch it for the moment, but search the real cause.
Now I see it here also (I tested it with 8248).
Hope to find it soon.
Jenna:
First I thoght it is caused by changes in ScintillWX.cpp:DoPaint(), but it works correctly in the stc-sample of wxWidgets trunk (after patching it to highlight occurrences).
And they have the same changes (in fact they are taken from there, I guess).
The call to Refresh as workaround, after the ClearRange call should not be too harmful.
dmoore:
I think the issue is in Editor::NotifyModified (line 4578 of Editor.cxx), in particular:
--- Code: --- if (mh.modificationType & (SC_MOD_CHANGESTYLE | SC_MOD_CHANGEINDICATOR)) {
if (mh.modificationType & SC_MOD_CHANGESTYLE) {
pdoc->IncrementStyleClock();
}
if (paintState == notPainting) { // ***********************
if (mh.position < pdoc->LineStart(topLine)) {
// Styling performed before this view
Redraw();
} else {
InvalidateRange(mh.position, mh.position + mh.length);
}
}
if (mh.modificationType & SC_MOD_CHANGESTYLE) {
llc.Invalidate(LineLayout::llCheckTextAndStyle);
}
--- End code ---
Because we have a cursor move paintstate!=notPainting, (see the line marked with ********) but that cursor move only invalidates the region between the new and old positions, we don't get the full redraw that we need. A simple (but potentially inefficient) fix would be to skip the paintstate check.
I think we could also make a highlight mode code a little more efficient by only clearing the highlight if we have previously set it.
dmoore:
btw, either approach seems to work fine on my netbook (doesn't slow things down too much). I would still advocate reducing the number of ClearRange calls, because that could be expensive on a really big file.
I don't understand why this wouldn't also affect the wx demo.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version