the knob labels are centered between the right border of the middle knobs and the right border of the display

This commit is contained in:
SallarShayegan
2025-02-28 15:21:31 +01:00
parent 31ae63b594
commit df52042972

View File

@ -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))