mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-30 01:16:30 +02:00
Issue #84: fix stroke width.
This commit is contained in:
parent
a0d25b87d4
commit
46d0f96303
1 changed files with 8 additions and 8 deletions
|
@ -465,7 +465,7 @@ def get_curve_points(
|
||||||
:param center: road intersection point
|
:param center: road intersection point
|
||||||
:param road_end: end point of the road segment
|
:param road_end: end point of the road segment
|
||||||
"""
|
"""
|
||||||
width: float = road.width / 2.0 * scale + 0.5
|
width: float = road.width / 2.0 * scale
|
||||||
|
|
||||||
direction: np.ndarray = (road_end - center) / np.linalg.norm(
|
direction: np.ndarray = (road_end - center) / np.linalg.norm(
|
||||||
road_end - center
|
road_end - center
|
||||||
|
@ -520,13 +520,13 @@ class Connector:
|
||||||
|
|
||||||
def draw_border(self, svg: Drawing) -> None:
|
def draw_border(self, svg: Drawing) -> None:
|
||||||
"""Draw connection outline."""
|
"""Draw connection outline."""
|
||||||
for curve in self.curve_1, self.curve_2:
|
path = svg.path(
|
||||||
path = svg.path(
|
d=["M"] + self.curve_1 + ["L"] + self.curve_2 + ["Z"],
|
||||||
d=["M"] + curve,
|
fill="none",
|
||||||
fill="none",
|
stroke=self.road_1.matcher.border_color.hex,
|
||||||
stroke=self.road_1.matcher.border_color.hex,
|
stroke_width=2,
|
||||||
)
|
)
|
||||||
svg.add(path)
|
svg.add(path)
|
||||||
|
|
||||||
|
|
||||||
class Roads:
|
class Roads:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue