It renders. I should hang out with my wife.
This commit is contained in:
parent
7fdf256448
commit
9153068018
2 changed files with 7 additions and 11 deletions
|
@ -154,9 +154,9 @@ class Cluster():
|
||||||
rpm_redline,
|
rpm_redline,
|
||||||
rpm_max)
|
rpm_max)
|
||||||
|
|
||||||
self.status = StatusIconBox(478, 276,
|
self.status = StatusIconBox(478, 280,
|
||||||
StatusIconBox.ICON_WIDTH * 10,
|
StatusIconBox.ICON_WIDTH * 6,
|
||||||
StatusIconBox.ICON_HEIGHT * 2)
|
StatusIconBox.ICON_HEIGHT * 3)
|
||||||
|
|
||||||
self.gauges.append(self.speedo)
|
self.gauges.append(self.speedo)
|
||||||
self.gauges.append(self.fuel)
|
self.gauges.append(self.fuel)
|
||||||
|
@ -203,7 +203,4 @@ class Cluster():
|
||||||
|
|
||||||
def draw_fg(self, cr: cairo.Context):
|
def draw_fg(self, cr: cairo.Context):
|
||||||
for gauge in self.gauges:
|
for gauge in self.gauges:
|
||||||
fn = getattr(gauge, 'draw_fg', None)
|
gauge.draw_fg(cr)
|
||||||
|
|
||||||
if fn is not None:
|
|
||||||
fn(cr)
|
|
||||||
|
|
|
@ -40,8 +40,7 @@ class ISO7000Icon():
|
||||||
self.surface.finish()
|
self.surface.finish()
|
||||||
|
|
||||||
def draw(self, cr: cairo.Context, x: float, y: float):
|
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, x, y)
|
||||||
cr.set_source_surface(self.surface, 0, 0)
|
|
||||||
cr.rectangle(x, y, self.width, self.height)
|
cr.rectangle(x, y, self.width, self.height)
|
||||||
cr.fill()
|
cr.fill()
|
||||||
|
|
||||||
|
@ -86,8 +85,8 @@ class ISO7000():
|
||||||
class StatusIconBox(Gauge):
|
class StatusIconBox(Gauge):
|
||||||
__slots__ = 'x', 'y', 'width', 'height', 'iso7000', 'value',
|
__slots__ = 'x', 'y', 'width', 'height', 'iso7000', 'value',
|
||||||
|
|
||||||
ICON_WIDTH = 32
|
ICON_WIDTH = 48
|
||||||
ICON_HEIGHT = 32
|
ICON_HEIGHT = 48
|
||||||
|
|
||||||
def __init__(self, x: float, y: float, width: float, height: float):
|
def __init__(self, x: float, y: float, width: float, height: float):
|
||||||
self.x = x
|
self.x = x
|
||||||
|
|
Loading…
Add table
Reference in a new issue