예제 #1
0
 public void RecordUndo(CanvasState state)
 {
     if (undostack.Count > 0 && undostack.Last.Equals(state))
     {
         return;
     }
     undostack.AddLast(state);
     if (undostack.Count > 20)
     {
         undostack.RemoveFirst();
     }
 }
예제 #2
0
        CanvasState MakeState(Rectangle area)
        {
            var sel = Selection;

            _selection = area;
            var r = new CanvasState()
            {
                data      = Copy(),
                area      = area,
                selection = sel,
            };

            _selection = sel;
            return(r);
        }
예제 #3
0
 void ApplyState(CanvasState state)
 {
     _selection = state.area;
     Paste(state.data, false);
     Selection = state.selection;
 }