diff --git a/py/hexagram/cluster.py b/py/hexagram/cluster.py index 2b0e969..969b028 100644 --- a/py/hexagram/cluster.py +++ b/py/hexagram/cluster.py @@ -154,9 +154,9 @@ class Cluster(): rpm_redline, rpm_max) - self.status = StatusIconBox(478, 276, - StatusIconBox.ICON_WIDTH * 10, - StatusIconBox.ICON_HEIGHT * 2) + self.status = StatusIconBox(478, 280, + StatusIconBox.ICON_WIDTH * 6, + StatusIconBox.ICON_HEIGHT * 3) self.gauges.append(self.speedo) self.gauges.append(self.fuel) @@ -203,7 +203,4 @@ class Cluster(): def draw_fg(self, cr: cairo.Context): for gauge in self.gauges: - fn = getattr(gauge, 'draw_fg', None) - - if fn is not None: - fn(cr) + gauge.draw_fg(cr) diff --git a/py/hexagram/icons.py b/py/hexagram/icons.py index 2a950aa..8c952d4 100644 --- a/py/hexagram/icons.py +++ b/py/hexagram/icons.py @@ -40,8 +40,7 @@ class ISO7000Icon(): self.surface.finish() def draw(self, cr: cairo.Context, x: float, y: float): - print(f"Drawing! {self.status}, {x}, {y}, {self.width}, {self.height}, {self.color}") - cr.set_source_surface(self.surface, 0, 0) + cr.set_source_surface(self.surface, x, y) cr.rectangle(x, y, self.width, self.height) cr.fill() @@ -86,8 +85,8 @@ class ISO7000(): class StatusIconBox(Gauge): __slots__ = 'x', 'y', 'width', 'height', 'iso7000', 'value', - ICON_WIDTH = 32 - ICON_HEIGHT = 32 + ICON_WIDTH = 48 + ICON_HEIGHT = 48 def __init__(self, x: float, y: float, width: float, height: float): self.x = x