Marko Toplak avatar Marko Toplak committed c08f8de

OWPaintData: Fixed an undo bug.

Comments (0)

Files changed (1)

Orange/OrangeWidgets/Data/OWPaintData.py

             return
         # if we start updating from previously undone actions, we cut off redos in our history
         if not self.historyCounter == len(self.dataHistory)-1:
-            self.dataHistory = self.dataHistory[0:self.historyCounter+1]
+            self.dataHistory = self.dataHistory[:self.historyCounter+1]
         # append an update of labels and data
         labels = list(self.classValuesModel)
         self.dataHistory.append((copy.deepcopy(self.graph.data), labels))
                 self.addNewClassLabel()
             # if not, update data
             else:
-                self.graph.data = data
+                self.graph.data = copy.deepcopy(data)
                 self.graph.updateGraph()
             self.updateHistoryBool = True
 
             elif len(self.classValuesModel) < len(labels):
                 self.addNewClassLabel()
             else:
-                self.graph.data = data
+                self.graph.data = copy.deepcopy(data)
                 self.graph.updateGraph()
             self.updateHistoryBool = True
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.