From 9eec6020f74aae47d244f6145f095b2aa468a637 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Wed, 15 May 2024 13:40:15 +0200 Subject: [PATCH] Arch: Fixed trackers ending too soon - fixes #13915 --- src/Mod/BIM/ArchStructure.py | 5 ++++- src/Mod/BIM/bimcommands/BimWall.py | 5 ++++- src/Mod/BIM/bimcommands/BimWindow.py | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Mod/BIM/ArchStructure.py b/src/Mod/BIM/ArchStructure.py index 322c9fd5f2..d4250c2905 100644 --- a/src/Mod/BIM/ArchStructure.py +++ b/src/Mod/BIM/ArchStructure.py @@ -24,6 +24,7 @@ import FreeCAD,Draft,ArchComponent,DraftVecUtils,ArchCommands from FreeCAD import Vector import ArchProfile from draftutils import params +from draftutils import gui_utils if FreeCAD.GuiUp: import FreeCADGui @@ -342,7 +343,7 @@ class _CommandStructure: self.bpoint = point FreeCADGui.Snapper.getPoint(last=point,callback=self.getPoint,movecallback=self.update,extradlg=[self.taskbox(),self.precast.form,self.dents.form],title=translate("Arch","Next point")+":",mode="line") return - self.tracker.finalize() + self.tracker.off() FreeCAD.activeDraftCommand = None FreeCADGui.Snapper.off() horiz = True # determines the type of rotation to apply to the final object @@ -410,6 +411,8 @@ class _CommandStructure: FreeCADGui.doCommand("Draft.autogroup(s)") FreeCAD.ActiveDocument.commitTransaction() FreeCAD.ActiveDocument.recompute() + gui_utils.end_all_events() + self.tracker.finalize() if self.continueCmd: self.Activated() diff --git a/src/Mod/BIM/bimcommands/BimWall.py b/src/Mod/BIM/bimcommands/BimWall.py index f54b0108b3..eff94586d1 100644 --- a/src/Mod/BIM/bimcommands/BimWall.py +++ b/src/Mod/BIM/bimcommands/BimWall.py @@ -133,6 +133,7 @@ class Arch_Wall: import Draft import Part + from draftutils import gui_utils if obj: if Draft.getType(obj) == "Wall": if not obj in self.existing: @@ -156,7 +157,7 @@ class Arch_Wall: elif len(self.points) == 2: l = Part.LineSegment(self.wp.get_local_coords(self.points[0]), self.wp.get_local_coords(self.points[1])) - self.tracker.finalize() + self.tracker.off() FreeCAD.activeDraftCommand = None FreeCADGui.Snapper.off() FreeCAD.ActiveDocument.openTransaction(translate("Arch","Create Wall")) @@ -187,6 +188,8 @@ class Arch_Wall: FreeCADGui.doCommand('Arch.addComponents(FreeCAD.ActiveDocument.'+FreeCAD.ActiveDocument.Objects[-1].Name+',FreeCAD.ActiveDocument.'+self.existing[0].Name+')') FreeCAD.ActiveDocument.commitTransaction() FreeCAD.ActiveDocument.recompute() + gui_utils.end_all_events() + self.tracker.finalize() if self.continueCmd: self.Activated() diff --git a/src/Mod/BIM/bimcommands/BimWindow.py b/src/Mod/BIM/bimcommands/BimWindow.py index 108ef439c7..5b95b8f10b 100644 --- a/src/Mod/BIM/bimcommands/BimWindow.py +++ b/src/Mod/BIM/bimcommands/BimWindow.py @@ -152,8 +152,9 @@ class Arch_Window: "this function is called by the snapper when it has a 3D point" import Draft - self.tracker.finalize() + from draftutils import gui_utils from ArchWindowPresets import WindowPresets + self.tracker.off() if point is None: return # if something was selected, override the underlying object @@ -221,6 +222,8 @@ class Arch_Window: FreeCAD.ActiveDocument.commitTransaction() FreeCAD.ActiveDocument.recompute() + gui_utils.end_all_events() + self.tracker.finalize() return def update(self,point,info):