commit 0f71a3ba6ac8a9cd294561dfadf46f7877ca093e
parent ef4a98aba49c5feb9099df8eb41a424440769d66
Author: Michael Savage <mikejsavage@gmail.com>
Date: Fri, 7 Sep 2018 22:54:43 +0300
Don't dirty textboxes while scrolled up
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/textbox.cc b/src/textbox.cc
@@ -53,17 +53,18 @@ void textbox_add( TextBox * tb, const char * str, size_t len, Colour fg, Colour
}
void textbox_newline( TextBox * tb ) {
- tb->dirty = true;
-
if( tb->num_lines < tb->max_lines ) {
tb->num_lines++;
if( tb->scroll_offset > 0 )
tb->scroll_offset++;
+ else
+ tb->dirty = true;
return;
}
tb->head++;
tb->scroll_offset = min( tb->scroll_offset + 1, tb->num_lines - 1 );
+ tb->dirty = true;
TextBox::Line * line = &tb->lines[ ( tb->head + tb->num_lines ) % tb->max_lines ];
line->len = 0;