diff options
Diffstat (limited to 'normal.py')
| -rw-r--r-- | normal.py | 35 |
1 files changed, 22 insertions, 13 deletions
@@ -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]) |
