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.
Type of changes
Checklist
Description
I was met with flickering on renderables that automatically refresh. This was not fixed with reducing the refresh rate.
After digging through the code, I found the reason. Rendering involves the following steps:
This leads to an unavoidable case whereby the screen will be cleared after the origin before drawing again. This may not be noticeable or an issue on:
My changes completely fix the flickering problem by taking a more efficient and direct approach to rendering:
\e[nFinstead of repeating\e[nA) the amount of lines\e[0K, erasing any line residuals\e[0J, clearing any screen residualsThis is more efficient because less ansi sequences are used for moving the cursor. It also completely eliminated flickering as the screen is never fully cleared between draw calls.
To achieve this, I had to introduce
\e[nF(move to the start of n lines up) inControlTypeand I also included the not-used\e[nG(move to the start of n lines down) for completeness. I also had to modifyControlType.CLEARto accept a parameter and backfixed any cases where it was already used.A lot of tests fail as a result of this change due to the fact that every render now has a different inherent structure. I am not sure whether a pull request expects me to implement those tests from scratch, but I am not able to regardless due to time constraints at this time.