diff --git a/.gitignore b/.gitignore index df50e4a..5012171 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,11 @@ missed_tags.yml # Test scheme files *.tm2 + +# Cache + +map/ # OSM XML files + +# Generated files + +icon_set/ # Generated SVG icon files diff --git a/doc/grid.png b/doc/grid.png index 994c4a7..3279038 100644 Binary files a/doc/grid.png and b/doc/grid.png differ diff --git a/icons/icons.svg b/icons/icons.svg index b9e66cf..b4faf26 100644 --- a/icons/icons.svg +++ b/icons/icons.svg @@ -171,9 +171,9 @@ showgrid="false" inkscape:document-units="px" inkscape:current-layer="layer1" - inkscape:cy="132.85433" - inkscape:cx="263.20995" - inkscape:zoom="5.6568542" + inkscape:cy="95.082327" + inkscape:cx="248.78527" + inkscape:zoom="4" inkscape:pageshadow="2" inkscape:pageopacity="0.0" borderopacity="1.0" @@ -566,6 +566,11 @@ inkscape:label="main" id="layer1" style="display:inline"> + slide - umbrella + + + vertical rounded rectangle + + + + + crossed vertical rounded rectangle + diff --git a/roentgen/point.py b/roentgen/point.py index 3331200..a8962e2 100644 --- a/roentgen/point.py +++ b/roentgen/point.py @@ -148,7 +148,9 @@ class Point(Tagged): return True - def draw_texts(self, svg: svgwrite.Drawing, occupied: Occupied) -> None: + def draw_texts( + self, svg: svgwrite.Drawing, occupied: Optional[Occupied] + ) -> None: """ Draw all labels. """ @@ -163,10 +165,11 @@ class Point(Tagged): ) def draw_text( - self, svg: svgwrite.Drawing, text: str, point, occupied: Occupied, - fill: Color, size: float = 10.0, out_fill=Color("white"), - out_opacity: float = 0.5, out_fill_2: Optional[Color] = None, - out_opacity_2: float = 1.0 + self, svg: svgwrite.Drawing, text: str, point, + occupied: Optional[Occupied], fill: Color, size: float = 10.0, + out_fill=Color("white"), out_opacity: float = 0.5, + out_fill_2: Optional[Color] = None, out_opacity_2: float = 1.0, + is_debug: bool = False ) -> None: """ Drawing text. @@ -177,6 +180,8 @@ class Point(Tagged): #------# ###### """ + self.y += 2 + length = len(text) * 6 if occupied: @@ -192,7 +197,8 @@ class Point(Tagged): for i in range(-int(length / 2), int(length / 2)): for j in range(-12, 5): occupied.register((int(point[0] + i), int(point[1] + j))) - # svg.add(svg.rect((point[0] + i, point[1] + j), (1, 1))) + if is_debug: + svg.add(svg.rect((point[0] + i, point[1] + j), (1, 1))) if out_fill_2: svg.add(svg.text( diff --git a/scheme/default.yml b/scheme/default.yml index 04c57f6..5436700 100644 --- a/scheme/default.yml +++ b/scheme/default.yml @@ -836,6 +836,11 @@ node_icons: - tags: {recycling:glass_bottles: "yes"} add_icon: [bottle] + - tags: {crossing:island: "yes"} + add_icon: [rectangle_vertical_rounded] + - tags: {crossing:island: "no"} + add_icon: [rectangle_vertical_rounded_crossed] + ways: - tags: {indoor: area} stroke: indoor_border_color diff --git a/test/test_icons.py b/test/test_icons.py index f3611b7..7a74d89 100644 --- a/test/test_icons.py +++ b/test/test_icons.py @@ -1,4 +1,6 @@ """ +Test icon generation for nodes. + Author: Sergey Vartanov (me@enzet.ru). """ from os import makedirs diff --git a/test/test_label.py b/test/test_label.py index fe53f1b..0acccc7 100644 --- a/test/test_label.py +++ b/test/test_label.py @@ -1,4 +1,6 @@ """ +Test label generation for nodes. + Author: Sergey Vartanov (me@enzet.ru). """ from typing import List