def redo(self): layer = self.doc.layers[self.layer_idx] if self.ignore_first_redo: # these are typically created interactively, after # the entire layer has been moved self.ignore_first_redo = False else: layer.translate(self.dx, self.dy) self._notify_canvas_observers([layer]) self._notify_document_observers()
def move_current_layer(self, dx, dy): layer = self.layers[self.layer_idx] layer.translate(dx, dy)
def undo(self): layer = self.doc.layers[self.layer_idx] layer.translate(-self.dx, -self.dy) self._notify_canvas_observers([layer]) self._notify_document_observers()