Code clearing window was using global font instead of the font actual… #72127
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…ly passed to draw_window
Summary
Bugfixes "Fix for ASCII terrain not clearing window correctly when using map font dimensions different than the global font"
Purpose of change
I play in ASCII mode and after recent updates I noticed incorrect visual artifacts in unexplored areas in the half of the window to the right of my character. For example, if I open the map then close it, unexplored tiles in the affected area would still show the content from the map.
After some investigation it turns out that the code that draws the window is clearing it using global font dimensions, and because I was using a map font with double the width of the global font, only half my terrain window was being cleared correctly. Setting my map font to the same dimensions as the global font hides this problem.
To reproduce, start in ASCII mode with a map font that has dimensions different to the global font (a width or height that is twice the global highlights the problem quite well). Open the map and close it to see the problem.
The issue does not happen when using tiles as far as I could see.
Describe the solution
Modified the code to calculate clear rectangle based on the font passed to the draw_window method.
Describe alternatives you've considered
None.
Testing
Manual testing to verify fix.
Additional context
None.