-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clear window line by line, skipping untouched lines #72035
clear window line by line, skipping untouched lines #72035
Conversation
Many of the windows in the game, especially the ones with scrollbars, create multiple overlapping windows and then draw them in an odd order. This results in overdraw, but that was partly compensated for by the cache that we removed. Now that we clear the whole window in one go, this causes artifacts as we erase text that was already drawn in a different window that overlaps the current one. By erasing only the lines that are touched, we avoid the problem. Fixes CleverRaven#71994.
Our code has always worked in curses so I think the SDL framebuffer code was simply mimicking curses behavior.
I think this PR is the correct solution as it avoids inconsistencies between the curses and SDL builds which might make testing harder.
Was this (instead of erasing the cells that are touched) the behavior before the removal? I'm worried that undrawn parts of a line might still be overwritten. |
Very likely.
Yes. Either the line was touched or it was not, and the lines are all filled with spaces when the window is created. Thus the whole line is drawn no matter what. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
I compiled this locally and it seemed to fix the issue |
Hotkey menu for the hotkey menu?
|
Separate bug reports for separate bugs please! |
Done.
Is it a bug? Or is it normal? And these are for attention. I apologize if you've already seen them. |
You're supposed to be able to change the keybindings of the keybindings menu itself, so it is expected, unless something else is wrong. |
…ven#72035)" This reverts commit 60757df.
…ven#72035)" This reverts commit 60757df.
Summary
Bugfixes "fix windows with missing header text"
Purpose of change
Describe the solution
Many of the windows in the game, especially the ones with scrollbars, create multiple overlapping windows and then draw them in an odd order. This results in overdraw, but that was partly compensated for by the cache that we removed. Now that we clear the whole window in one go, this causes artifacts as we erase text that was already drawn in a different window that overlaps the current one. By erasing only the lines that are touched, we avoid the problem.
Fixes #71994.
Describe alternatives you've considered
We could just change every window to avoid the overdraw. It is almost always because it goes back and calls
draw_scrollbar
to add a scrollbar to the window after it has already drawn the window border and header text. By moving the call todraw_scrollbar
up so that it happens before printing the header text, the problem would also be avoided.Testing
I just manually tried out every window I could find that has a header and a scrollbar, including those mentioned in the bug report.