Move color setting to SPCOutlookMap
This commit is contained in:
parent
8f679c5337
commit
445d43c702
2 changed files with 7 additions and 7 deletions
|
@ -78,7 +78,7 @@ class EquirectMap():
|
||||||
else:
|
else:
|
||||||
cr.line_to(x, y)
|
cr.line_to(x, y)
|
||||||
|
|
||||||
def draw_city(self, cr: cairo.Context, city: City, dark: bool=False):
|
def draw_city(self, cr: cairo.Context, city: City):
|
||||||
cr.save()
|
cr.save()
|
||||||
|
|
||||||
x, y = self.map_to_screen(city.location)
|
x, y = self.map_to_screen(city.location)
|
||||||
|
@ -96,11 +96,6 @@ class EquirectMap():
|
||||||
|
|
||||||
extents = cr.text_extents(city.name)
|
extents = cr.text_extents(city.name)
|
||||||
|
|
||||||
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.arc(x, y, radius, 0, 2*math.pi)
|
||||||
cr.fill()
|
cr.fill()
|
||||||
|
|
||||||
|
|
|
@ -925,4 +925,9 @@ class SPCOutlookMap(EquirectMap):
|
||||||
if city is None:
|
if city is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
self.draw_city(cr, city, self.dark)
|
if self.dark:
|
||||||
|
cr.set_source_rgb(0.9, 0.9, 0.9)
|
||||||
|
else:
|
||||||
|
cr.set_source_rgb(0.1, 0.1, 0.1)
|
||||||
|
|
||||||
|
self.draw_city(cr, city)
|
||||||
|
|
Loading…
Add table
Reference in a new issue