Fix linter complaint

This commit is contained in:
XANTRONIX 2025-03-30 00:32:27 -04:00
parent 66392f0612
commit 606dda3c14

View file

@ -289,7 +289,11 @@ class Hodograph():
cr.rectangle(offset + x, y + width * 1.5, width, width) cr.rectangle(offset + x, y + width * 1.5, width, width)
cr.stroke() cr.stroke()
text = "%dm" % (height) if height < 1000 else "%dkm" % (height /1000) if height < 1000:
text = "%dm" % (height)
else:
text = "%dkm" % (int(height / 1000.0))
extents = cr.text_extents(text) extents = cr.text_extents(text)
cr.move_to(offset + x - extents.width / 4, y + 3.5*width) cr.move_to(offset + x - extents.width / 4, y + 3.5*width)