From 7bd70f9db1daf5daab0caf975c2af2313ab485b6 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Sat, 17 Jan 2026 00:52:11 +0100 Subject: [PATCH] Draft: fix snapping to geometry on image Fixes #26965 `self.snapObjectIndex` should be increased if the object under the cursor is not 'snappable'. This is the same principle as is used in the `cycleSnapObject` function. --- src/Mod/Draft/draftguitools/gui_snapper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Mod/Draft/draftguitools/gui_snapper.py b/src/Mod/Draft/draftguitools/gui_snapper.py index 2ec3ae0567..2fe274e23a 100644 --- a/src/Mod/Draft/draftguitools/gui_snapper.py +++ b/src/Mod/Draft/draftguitools/gui_snapper.py @@ -351,7 +351,7 @@ class Snapper: def cycleSnapObject(self): """Increase the index of the snap object by one.""" - self.snapObjectIndex = self.snapObjectIndex + 1 + self.snapObjectIndex += 1 def snapToObject(self, lastpoint, active, constrain, eline, point): """Snap to an object.""" @@ -373,6 +373,8 @@ class Snapper: or Draft.getType(obj) in UNSNAPPABLES or not getattr(obj.ViewObject, "Selectable", True) ): + # increase snapObjectIndex to find other objects under the cursor: + self.snapObjectIndex += 1 return None snaps = []