예제 #1
0
 def undo(self):
     """Updates the document as needed when undo() is invoked"""
     # When called, this is always reversing a previous redo().
     # Update the doc and send notifications.
     assert self._move is None
     if (self._x, self._y) == (self._x0, self._y0):
         return
     layer = self.doc.layer_stack.deepget(self._layer_path)
     dx = self._x - self._x0
     dy = self._y - self._y0
     redraw_bboxes = layer.translate(-dx, -dy)
     self._notify_canvas_observers(redraw_bboxes)
예제 #2
0
파일: command.py 프로젝트: Xananax/dopey
 def undo(self):
     """Updates the document as needed when undo() is invoked"""
     # When called, this is always reversing a previous redo().
     # Update the doc and send notifications.
     assert self._move is None
     if (self._x, self._y) == (self._x0, self._y0):
         return
     layer = self.doc.layer_stack.deepget(self._layer_path)
     dx = self._x - self._x0
     dy = self._y - self._y0
     redraw_bboxes = layer.translate(-dx, -dy)
     self._notify_canvas_observers(redraw_bboxes)
예제 #3
0
 def redo(self):
     """Updates the document as needed when do()/redo() is invoked"""
     # The first time this is called, finish up the active move.
     # Doc has already been updated, and notifications were sent.
     if self._move is not None:
         assert self._processing_complete
         self._move.cleanup()
         self._move = None
         return
     # Any second invocation is always reversing a previous undo().
     # Need to do doc updates and send notifications this time.
     if (self._x, self._y) == (self._x0, self._y0):
         return
     layer = self.doc.layer_stack.deepget(self._layer_path)
     dx = self._x - self._x0
     dy = self._y - self._y0
     redraw_bboxes = layer.translate(dx, dy)
     self._notify_canvas_observers(redraw_bboxes)
예제 #4
0
파일: command.py 프로젝트: Xananax/dopey
 def redo(self):
     """Updates the document as needed when do()/redo() is invoked"""
     # The first time this is called, finish up the active move.
     # Doc has already been updated, and notifications were sent.
     if self._move is not None:
         assert self._processing_complete
         self._move.cleanup()
         self._move = None
         return
     # Any second invocation is always reversing a previous undo().
     # Need to do doc updates and send notifications this time.
     if (self._x, self._y) == (self._x0, self._y0):
         return
     layer = self.doc.layer_stack.deepget(self._layer_path)
     dx = self._x - self._x0
     dy = self._y - self._y0
     redraw_bboxes = layer.translate(dx, dy)
     self._notify_canvas_observers(redraw_bboxes)