summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Vink <mike1994vink@gmail.com>2021-09-28 13:45:33 +0200
committerMike Vink <mike1994vink@gmail.com>2021-09-28 13:45:33 +0200
commit8672543a495f70756aeca42177f615da1a91c755 (patch)
tree84590058ae618fca1742346fc10b7f3200c96892
parentf05c6aa438d7b51ba60aa80853c287f418bfef48 (diff)
mozilla.../docs/Web/SVG/Element/marker
-rw-r--r--normal.py35
1 files changed, 22 insertions, 13 deletions
diff --git a/normal.py b/normal.py
index 7fadcc9..1584812 100644
--- a/normal.py
+++ b/normal.py
@@ -42,10 +42,10 @@ def normal_mode(self, event, char):
if event.type == X.KeyPress and char:
pressed.add(event_to_string(self, event))
- return
+ return
if event.type != X.KeyRelease:
- return
+ return
handled = False
if len(pressed) > 1:
@@ -55,7 +55,7 @@ def normal_mode(self, event, char):
# Get the only element in pressed
ev = next(iter(pressed))
handled = handle_single_key(self, ev)
-
+
# replay events to Inkscape if we couldn't handle them
if not handled:
replay(self)
@@ -191,19 +191,28 @@ def paste_style(self, combination):
svg += f'''
<defs id="marker-defs">
<marker
- id="marker-arrow-{w}"
- orient="auto-start-reverse"
- refY="0" refX="0"
- markerHeight="1.690" markerWidth="0.911">
- <g transform="scale({(2.40 * w + 3.87)/(4.5*w)})">
- <path
- d="M -1.55415,2.0722 C -1.42464,1.29512 0,0.1295 0.38852,0 0,-0.1295 -1.42464,-1.29512 -1.55415,-2.0722"
- style="fill:none;stroke:#000000;stroke-width:{0.6};stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
- inkscape:connector-curvature="0" />
- </g>
+ id="marker-arrow-{w}"
+ viewBox="0 0 10 10"
+ refX="5" refY="5"
+ markerWidth="6" markerHeight="6"
+ orient="auto-start-reverse">
+ <path d="M 0 0 L 10 5 L 0 10 z" />
</marker>
</defs>
'''
+# TODO test if the new arrow actually works
+# <marker
+# id="marker-arrow-{w}"
+# orient="auto-start-reverse"
+# refY="0" refX="0"
+# markerHeight="1.690" markerWidth="0.911">
+# <g transform="scale({(8.40 * w + 3.87)/(4.5*w)})">
+# <path
+# d="M -1.55415,2.0722 C -1.42464,1.29512 0,0.1295 0.38852,0 0,-0.1295 -1.42464,-1.29512 -1.55415,-2.0722"
+# style="fill:none;stroke:#000000;stroke-width:{0.6};stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
+# inkscape:connector-curvature="0" />
+# </g>
+# </marker>
style_string = ';'.join('{}: {}'.format(key, value)
for key, value in sorted(style.items(), key=lambda x: x[0])