From df52042972f1c9c3f50cfb61200bba754d7fae0b Mon Sep 17 00:00:00 2001 From: SallarShayegan Date: Fri, 28 Feb 2025 15:21:31 +0100 Subject: [PATCH] the knob labels are centered between the right border of the middle knobs and the right border of the display --- knobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/knobs.py b/knobs.py index a9cbbc1..c6734f5 100644 --- a/knobs.py +++ b/knobs.py @@ -44,8 +44,8 @@ class Knobs: label_fx_name = font_helvetica.render(knob.name, False, color_primary_light) label_fx_value = font_helvetica.render('[ ' + str(int(round(knob.value * 100, 0))) + '% ]', False, color_primary_light) - - label_x = self.gui.screenW - label_fx_name.get_width() - 20 + min_x = self.knobs[5].get_position()[0] + self.knobs_radius * 1.5 + label_x = min_x + (self.gui.screenW - min_x - label_fx_name.get_width()) / 2 label_y = (self.gui.screenH - label_fx_name.get_height() - label_fx_value.get_height()) / 2 self.gui.screen.blit(label_fx_name, (label_x, label_y)) self.gui.screen.blit(label_fx_value, (label_x, self.gui.screenH / 2))