mudgangster

Log | Files | Refs

commit bec17acc262bd724ec8bea00ecbf0abefb07d008
parent 59565e1cb3cef4e9e73d9328b1b0c93e94ddace7
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Fri,  7 Sep 2018 17:05:48 +0300

Don't redraw if the text selection hasn't actually changed

Diffstat:
src/textbox.cc | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/textbox.cc b/src/textbox.cc @@ -126,9 +126,11 @@ void textbox_mouse_move( TextBox * tb, int window_x, int window_y ) { int row = ( tb->h - y ) / ( fh + SPACING ); int col = x / fw; - tb->selection_end_col = col; - tb->selection_end_row = row; - tb->dirty = true; + if( col != tb->selection_end_col || row != tb->selection_end_row ) { + tb->selection_end_col = col; + tb->selection_end_row = row; + tb->dirty = true; + } } void textbox_mouse_up( TextBox * tb, int window_x, int window_y ) {