mirror of
https://github.com/enzet/map-machine.git
synced 2025-06-06 04:41:54 +02:00
Issue #23: fix roof drawing.
Roof drawing is now based on the building levels.
This commit is contained in:
parent
51f40b989e
commit
6705f7418a
1 changed files with 6 additions and 14 deletions
|
@ -292,26 +292,18 @@ class Painter:
|
||||||
|
|
||||||
# Building roof
|
# Building roof
|
||||||
|
|
||||||
building_paths: List[(str, Dict)] = []
|
def sort_by_levels(building: Building):
|
||||||
|
return building.get_levels()
|
||||||
|
|
||||||
for way in constructor.buildings: # type: Building
|
for way in sorted(constructor.buildings, key=sort_by_levels): # type: Building
|
||||||
shift = [0, -3]
|
shift = [0, -3]
|
||||||
shift = np.array([
|
shift = np.array([
|
||||||
0 * way.get_levels(), min(-3, -1 * way.get_levels())])
|
0 * way.get_levels(), min(-3, -1 * way.get_levels())])
|
||||||
path: str = way.get_path(self.flinger, shift)
|
path: str = way.get_path(self.flinger, shift)
|
||||||
if path:
|
if path:
|
||||||
building_paths.append((path, way.style))
|
p = Path(d=path, opacity=1)
|
||||||
|
p.update(way.style)
|
||||||
for path, style in building_paths:
|
self.svg.add(p)
|
||||||
p = Path(d=path, opacity=1)
|
|
||||||
p.update(style)
|
|
||||||
p.update({"stroke": "none"})
|
|
||||||
self.svg.add(p)
|
|
||||||
for path, style in building_paths:
|
|
||||||
p = Path(d=path, opacity=1)
|
|
||||||
p.update(style)
|
|
||||||
p.update({"fill": "none"})
|
|
||||||
self.svg.add(p)
|
|
||||||
|
|
||||||
# Trees
|
# Trees
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue