Don't update the textbox canvas if the cursor alpha didn't change

This commit is contained in:
Celtic Minstrel 2017-05-12 15:33:45 -04:00
parent a1f481f539
commit 640e28f731

View file

@ -269,6 +269,7 @@ void text_box_base::toggle_cursor_timer(bool enable)
void text_box_base::cursor_timer_callback()
{
unsigned was_alpha = cursor_alpha_;
switch(state_) {
case DISABLED:
cursor_alpha_ = 0;
@ -284,6 +285,10 @@ void text_box_base::cursor_timer_callback()
}
}
if(was_alpha == cursor_alpha_) {
return;
}
for(auto& tmp : get_canvases()) {
tmp.set_variable("cursor_alpha", wfl::variant(cursor_alpha_));
}