Skip to content

Fixes #2611 bypass some repaint just after resize#2612

Merged
Dunbaratu merged 1 commit intoKSP-KOS:developfrom
Dunbaratu:fixes_2611_terminal_buffer_range_protection
Sep 4, 2019
Merged

Fixes #2611 bypass some repaint just after resize#2612
Dunbaratu merged 1 commit intoKSP-KOS:developfrom
Dunbaratu:fixes_2611_terminal_buffer_range_protection

Conversation

@Dunbaratu
Copy link
Member

@Dunbaratu Dunbaratu commented Sep 4, 2019

fixes #2611

Just after a GUI pass notices the terminal got resized,
the screen buffers are temporarily the wrong size for
the next GUI repaint pass. They will get corrected
later, but for a brief moment they're wrong, and that
was causing the exception. When the exception got
thrown, it aborted the GUI pass before the code that
recalculates the buffer size gets reached, so the same
exception happens again the next pass, and so on.

The fix was to just let the repaint pass work with
the wrong buffer size (protecting against the things
being out of bounds, and just painting the subset of the
buffer that fits). On the next repaint pass after that
it should have the right buffer sizes recalced by then and
be able to paint it right.

Just after a GUI pass notices the terminal got resized,
the screen buffers are temporarily the wrong size for
the next GUI repaint pass.  They will get corrected
later, but for a brief moment they're wrong, and that
was causing the exception.  When the exception got
thrown, it aborted the GUI pass before the code that
recalculates the buffer size gets reached, so the same
exception happens again the next pass, and so on.

The fix was to just let the repaint pass work with
the wrong buffer size (protecting against the things
being out of bounds, and just painting the subset of the
buffer that fits). On the next repaint pass after that
it should have the right buffer sizes recalced by then and
be able to paint it right.
@Dunbaratu Dunbaratu added bug Weird outcome is probably not what the mod programmer expected. had to skip peer review Use only when everyone else is on haitus and gave you permission. Others should check the PR later. labels Sep 4, 2019
@Dunbaratu Dunbaratu merged commit c08dd55 into KSP-KOS:develop Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Weird outcome is probably not what the mod programmer expected. had to skip peer review Use only when everyone else is on haitus and gave you permission. Others should check the PR later.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On screen terminal breaks when too small

1 participant