Perfection

This commit is contained in:
XANTRONIX Development 2024-01-01 17:16:04 -05:00
parent 160330a057
commit 8d73d6c184

View file

@ -58,12 +58,12 @@ class Dial(Gauge):
def draw_needle(self, cr: cairo.Context, min_radius: float, max_radius: float, value: float):
angle = self.min_angle + \
((self.max_angle - self.min_angle) * (value / self.max_value)) \
- self.ANGLE_OFFSET - 3 * (math.pi / 180.0)
- self.ANGLE_OFFSET - 2.2 * (math.pi / 180.0)
angle_start = angle - 3 * (math.pi / 180.0)
angle_end = angle + 3 * (math.pi / 180.0)
cr.set_source_rgba(1, 1, 1, 0.75)
cr.set_source_rgba(1, 0.4, 1, 0.75)
cr.move_to(self.x + (min_radius * self.radius) * math.cos(angle_start),
self.y + (min_radius * self.radius) * math.sin(angle_start))