Arch: Fixed trackers ending too soon - fixes #13915

This commit is contained in:
Yorik van Havre
2024-05-15 13:40:15 +02:00
committed by Yorik van Havre
parent f4fa7619c0
commit 9eec6020f7
3 changed files with 12 additions and 3 deletions

View File

@@ -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()

View File

@@ -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()

View File

@@ -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):