Optimize drawing of buttons with changing text
When a button has a fixed size, there's no need to call queue_resize(). This fixes an issue with the ArdourClock info displays when slaved. The Timecode and Delta display text changes in small intervals and caused excessive CPU load due to GUI size-requests + redraws.
This commit is contained in:
parent
58a5e256a9
commit
b36e6b8341
@ -212,7 +212,12 @@ ArdourButton::set_text (const std::string& str, bool markup)
|
|||||||
set_text_internal ();
|
set_text_internal ();
|
||||||
/* on_size_request() will fill in _text_width/height
|
/* on_size_request() will fill in _text_width/height
|
||||||
* so queue it even if _sizing_text != "" */
|
* so queue it even if _sizing_text != "" */
|
||||||
|
if (_sizing_text.empty ()) {
|
||||||
queue_resize ();
|
queue_resize ();
|
||||||
|
} else {
|
||||||
|
_layout->get_pixel_size (_text_width, _text_height);
|
||||||
|
CairoWidget::set_dirty ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user