Display speed in mph in centre of speedo
This commit is contained in:
parent
490390a433
commit
897e1e9661
1 changed files with 15 additions and 0 deletions
|
@ -41,3 +41,18 @@ class Speedo(Dial):
|
|||
|
||||
for speed in range(0, int(self.max_value)+1, 20):
|
||||
self.draw_number(cr, 0.68, speed, "%d" % int(speed))
|
||||
|
||||
def draw_fg(self, cr: cairo.Context):
|
||||
super().draw_fg(cr)
|
||||
|
||||
cr.select_font_face("Muli",
|
||||
cairo.FontSlant.ITALIC,
|
||||
cairo.FontWeight.BOLD)
|
||||
|
||||
cr.set_font_size(self.radius * 0.15)
|
||||
cr.set_source_rgb(1, 0.4, 1)
|
||||
|
||||
cr.move_to(self.x - (self.radius * 0.21),
|
||||
self.y + (self.radius * 0.05))
|
||||
|
||||
cr.show_text("%d mph" % self.value)
|
||||
|
|
Loading…
Add table
Reference in a new issue