Slight adjustment to heights legend

This commit is contained in:
XANTRONIX 2025-02-26 17:30:55 -05:00
parent f562664ecf
commit 28a3200a47

View file

@ -174,7 +174,7 @@ class Hodograph():
cr.save()
cr.set_source_rgb(1, 1, 1)
cr.rectangle(offset + x - width / 2,
cr.rectangle(offset + x - width * 0.75,
y + width,
interval * 4,
width * 3)
@ -182,7 +182,7 @@ class Hodograph():
cr.fill()
cr.set_source_rgb(0.8, 0.8, 0.8)
cr.rectangle(offset + x - width / 2,
cr.rectangle(offset + x - width * 0.75,
y + width,
interval * 4,
width * 3)
@ -201,13 +201,11 @@ class Hodograph():
cr.rectangle(offset + x, y + width * 1.5, width, width)
cr.stroke()
cr.move_to(offset + x, y + 3.5*width)
if height < 1000:
cr.show_text("%dm" % height)
else:
cr.show_text("%dkm" % (height / 1000))
text = "%dm" % (height) if height < 1000 else "%dkm" % (height /1000)
extents = cr.text_extents(text)
cr.move_to(offset + x - extents.width / 4, y + 3.5*width)
cr.show_text(text)
cr.stroke()
offset += interval