We all need defaults innit

This commit is contained in:
XANTRONIX Development 2024-01-01 19:16:28 -05:00
parent d4b3a40ab5
commit 78629a6301

View file

@ -15,6 +15,8 @@ class FuelGauge(Dial):
def __init__(self, x: float, y: float, radius: float):
super().__init__(x, y, radius, self.MIN_ANGLE, self.MAX_ANGLE, self.MAX_VALUE)
self.value = 0
def draw_value(self, cr: cairo.Context, radius: float, value: float, text: str, x_offset: float):
scale = (self.max_value - value) / self.max_value
angle = self.min_angle + ((self.max_angle - self.min_angle) * scale) - self.ANGLE_OFFSET