fixed a crash on escape from Image Scaling WB

This commit is contained in:
easyw
2018-06-29 11:26:34 +02:00
committed by Yorik van Havre
parent c36d84ba6c
commit f1096e8747
2 changed files with 5 additions and 2 deletions

View File

@@ -149,6 +149,7 @@ def cmdCreateImageScaling(name):
self.tracker.off()
self.tracker.finalize()
self.dialog.hide()
FreeCADGui.SendMsgToActiveView("ViewFit")
except (ValueError, ZeroDivisionError):
self.label1.setText(_translate("Dialog", "<font color='red'>Enter distance</font>", None))
return
@@ -157,9 +158,10 @@ def cmdCreateImageScaling(name):
return
def reject(self):
if len(self.stack) != 2:
self.view.removeEventCallbackPivy(pvy.SoMouseButtonEvent.getClassTypeId(),self.callback)
self.view.removeEventCallbackPivy(pvy.SoLocation2Event.getClassTypeId(),self.callmouse)
self.stack=[]
self.view.removeEventCallbackPivy(pvy.SoMouseButtonEvent.getClassTypeId(),self.callback)
self.view.removeEventCallbackPivy(pvy.SoLocation2Event.getClassTypeId(),self.callmouse)
self.tracker.off()
self.tracker.finalize()
self.dialog.hide()