Ensure city names are rendered correctly in dark mode

This commit is contained in:
XANTRONIX 2025-04-09 21:50:59 -04:00
parent d357734996
commit 8f679c5337
2 changed files with 7 additions and 3 deletions

View file

@ -78,7 +78,7 @@ class EquirectMap():
else:
cr.line_to(x, y)
def draw_city(self, cr: cairo.Context, city: City):
def draw_city(self, cr: cairo.Context, city: City, dark: bool=False):
cr.save()
x, y = self.map_to_screen(city.location)
@ -96,7 +96,11 @@ class EquirectMap():
extents = cr.text_extents(city.name)
cr.set_source_rgb(0.2, 0.2, 0.2)
if dark:
cr.set_source_rgb(0.9, 0.9, 0.9)
else:
cr.set_source_rgb(0.1, 0.1, 0.1)
cr.arc(x, y, radius, 0, 2*math.pi)
cr.fill()

View file

@ -925,4 +925,4 @@ class SPCOutlookMap(EquirectMap):
if city is None:
continue
self.draw_city(cr, city)
self.draw_city(cr, city, self.dark)