Rework FitChanged command to avoid refreshing graph multiple times in certain cases
This commit is contained in:
@@ -126,24 +126,24 @@ class CommandView(d.Display):
|
||||
def fitChanged(self, event):
|
||||
event.Skip()
|
||||
activeFitID = self.mainFrame.getActiveFit()
|
||||
if activeFitID is not None and event.fitID is not None and event.fitID != activeFitID:
|
||||
if activeFitID is not None and activeFitID not in event.fitIDs:
|
||||
return
|
||||
|
||||
sFit = Fit.getInstance()
|
||||
fit = sFit.getFit(event.fitID)
|
||||
fit = sFit.getFit(activeFitID)
|
||||
|
||||
AddCommandFit.populateFits(event)
|
||||
|
||||
self.Parent.Parent.DisablePage(self, not fit or fit.isStructure)
|
||||
|
||||
# Clear list and get out if current fitId is None
|
||||
if event.fitID is None and self.lastFitId is not None:
|
||||
if activeFitID is None and self.lastFitId is not None:
|
||||
self.DeleteAllItems()
|
||||
self.lastFitId = None
|
||||
return
|
||||
|
||||
if event.fitID != self.lastFitId:
|
||||
self.lastFitId = event.fitID
|
||||
if activeFitID != self.lastFitId:
|
||||
self.lastFitId = activeFitID
|
||||
|
||||
item = self.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_DONTCARE)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user