Fix sketcher mode handling to prevent unintended line creation during drag operations

Major changes:
- Fixed right-click handler to directly set mode to NONE instead of relying on main app signal handling
- Added safety checks in left-click handler to prevent drawing when no draggable point is found in NONE mode
- Enhanced mode compatibility by treating Python None as SketchMode.NONE in set_mode() method
- Added comprehensive debug logging for mode changes and interaction state tracking
- Resolved integration issue where persistent constraint modes were prematurely reset by main app
- Ensured point dragging is only enabled in NONE mode, preventing accidental polyline creation

This fixes the reported issue where deactivating the line tool would still create lines when dragging,
and ensures proper mode transitions between drawing tools and selection/drag mode.
This commit is contained in:
bklronin
2025-08-16 22:30:18 +02:00
parent 54261bb8fd
commit 11d053fda4
886 changed files with 168708 additions and 51 deletions

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Created with matplotlib (http://matplotlib.org/) -->
<svg height="72pt" version="1.1" viewBox="0 0 72 72" width="72pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<style type="text/css">
*{stroke-linecap:butt;stroke-linejoin:round;}
</style>
</defs>
<g id="figure_1">
<g id="patch_1">
<path d="M 0 72
L 72 72
L 72 0
L 0 0
z
" style="fill:none;opacity:0;"/>
</g>
<g id="text_1">
<path d="M 48.139062 32.589687
C 48.139062 41.960938 40.510312 49.589687 31.139063 49.589687
C 21.767812 49.589687 14.139062 41.960938 14.139062 32.589687
C 14.139062 23.218437 21.767812 15.589687 31.139063 15.589687
C 40.510312 15.589687 48.139062 23.218437 48.139062 32.589687
M 67.572187 64.156562
C 67.572187 62.870937 67.040937 61.617188 66.169688 60.745937
L 53.154062 47.730312
C 56.224688 43.289062 57.860938 37.976562 57.860938 32.589687
C 57.860938 17.820937 45.907813 5.867812 31.139063 5.867812
C 16.380937 5.867812 4.427812 17.820937 4.427812 32.589687
C 4.427812 47.347812 16.380937 59.300937 31.139063 59.300937
C 36.525937 59.300937 41.838437 57.664687 46.279687 54.594062
L 59.295313 67.577812
C 60.166562 68.480937 61.420313 69.012187 62.716563 69.012187
C 65.372813 69.012187 67.572187 66.812812 67.572187 64.156562
"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB