fix broken route rendering with locales others than english
This commit is contained in:
parent
3ed5b6c3e3
commit
1e5aab00f2
1 changed files with 8 additions and 6 deletions
|
@ -4,7 +4,7 @@
|
||||||
<div class="routeparts">
|
<div class="routeparts">
|
||||||
{% for routepart in route.routeparts %}
|
{% for routepart in route.routeparts %}
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="map" data-level="{{ routepart.level_name }}"
|
<svg xmlns="http://www.w3.org/2000/svg" class="map" data-level="{{ routepart.level_name }}"
|
||||||
viewBox="0 0 {{ routepart.svg_width }} {{ routepart.svg_height }}"
|
viewBox="0 0 {{ routepart.svg_width | stringformat:"f" }} {{ routepart.svg_height | stringformat:"f" }}"
|
||||||
style="max-height:{% if routepart.svg_height > 300 %}300{% else %}{{ routepart.svg_height }}{% endif %}px">
|
style="max-height:{% if routepart.svg_height > 300 %}300{% else %}{{ routepart.svg_height }}{% endif %}px">
|
||||||
<defs>
|
<defs>
|
||||||
<marker id="arrow-{{ forloop.counter0 }}" markerWidth="4" markerHeight="4" refX="2.5" refY="2" orient="auto">
|
<marker id="arrow-{{ forloop.counter0 }}" markerWidth="4" markerHeight="4" refX="2.5" refY="2" orient="auto">
|
||||||
|
@ -12,14 +12,16 @@
|
||||||
</marker>
|
</marker>
|
||||||
</defs>
|
</defs>
|
||||||
|
|
||||||
<image width="{{ svg_width }}" height="{{ svg_height }}" x="{{ routepart.svg_min_x | negate }}" y="{{ routepart.svg_min_y | negate }}" xlink:href="/map/{{ routepart.level_name }}.png"></image>
|
<image width="{{ svg_width | stringformat:"f" }}" height="{{ svg_height | stringformat:"f" }}"
|
||||||
|
x="{{ routepart.svg_min_x | negate | stringformat:"f" }}" y="{{ routepart.svg_min_y | negate | stringformat:"f" }}"
|
||||||
|
xlink:href="/map/{{ routepart.level_name }}.png"></image>
|
||||||
|
|
||||||
<g class="connections">
|
<g class="connections">
|
||||||
{% for c in routepart.connections %}
|
{% for c in routepart.connections %}
|
||||||
<line x1="{{ c.from_point.svg_x | subtract:routepart.svg_min_x }}"
|
<line x1="{{ c.from_point.svg_x | subtract:routepart.svg_min_x | stringformat:"f"}}"
|
||||||
y1="{{ c.from_point.svg_y | subtract:routepart.svg_min_y }}"
|
y1="{{ c.from_point.svg_y | subtract:routepart.svg_min_y | stringformat:"f" }}"
|
||||||
x2="{{ c.to_point.svg_x | subtract:routepart.svg_min_x }}"
|
x2="{{ c.to_point.svg_x | subtract:routepart.svg_min_x | stringformat:"f" }}"
|
||||||
y2="{{ c.to_point.svg_y | subtract:routepart.svg_min_y }}"
|
y2="{{ c.to_point.svg_y | subtract:routepart.svg_min_y | stringformat:"f" }}"
|
||||||
marker-end="url(#arrow-{{ forloop.parentloop.counter0 }})"></line>
|
marker-end="url(#arrow-{{ forloop.parentloop.counter0 }})"></line>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</g>
|
</g>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue