From f3ec590eb577d867356935b01f837979160ea5fa Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 6 Mar 2025 17:02:33 +0100 Subject: [PATCH] Dynamically update ArdourButton indicator Previously this was semi-random, on_size_request() may be called in response to some other widget changing size, before a given ArdourButton DPIReset handler could set _diameter = 0. --- libs/widgets/ardour_button.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libs/widgets/ardour_button.cc b/libs/widgets/ardour_button.cc index 7e4a397b9f..53f4bb09d2 100644 --- a/libs/widgets/ardour_button.cc +++ b/libs/widgets/ardour_button.cc @@ -691,12 +691,10 @@ ArdourButton::on_size_request (Gtk::Requisition* req) req->width = req->height = 0; CairoWidget::on_size_request (req); - if (_diameter == 0) { - const float newdia = rintf (11.f * UIConfigurationBase::instance().get_ui_scale()); - if (_diameter != newdia) { - _pattern_height = 0; - _diameter = newdia; - } + const float newdia = rintf (11.f * UIConfigurationBase::instance().get_ui_scale()); + if (_diameter != newdia) { + _pattern_height = 0; + _diameter = newdia; } if (_elements & Text) {