added the display_label method including the implementation of the visual path from the knobs to the label

This commit is contained in:
SallarShayegan
2025-02-24 12:15:20 +01:00
parent 3424674875
commit 77e92bf273
2 changed files with 42 additions and 15 deletions

View File

@ -21,8 +21,8 @@ class Knob:
def get_pointer_position(self):
angle = (self.value * 0.8 * 2 + 0.7) * math.pi
x = self.radius * math.cos(angle) + self.position[0]
y = self.radius * math.sin(angle) + self.position[1]
x = (self.radius - 5) * math.cos(angle) + self.position[0]
y = (self.radius - 5) * math.sin(angle) + self.position[1]
return(x, y)
def display(self):