pub fn undo_save(&self) {
        let image = self.image.borrow_mut();
        self.undo_image.borrow_mut().push(image.clone());
        // prevents undo stack to grow too much!!
        self.undo_pos.set(self.undo_pos.get()+1);
        if self.undo_image.borrow_mut().len() > UNDODEPTH {
            self.undo_image.borrow_mut().remove(0);
            self.undo_pos.set(self.undo_pos.get()-1);
        }
    }
/// save image state to undo stack 
save image state to undo stack
save image state to undo stack
pub fn undo_save(&self) {
        let image = self.image.borrow_mut();
        self.undo_image.borrow_mut().push(image.clone());
        // prevents undo stack to grow too much!!
        self.undo_pos.set(self.undo_pos.get()+1);
        if self.undo_image.borrow_mut().len() > UNDODEPTH {
            self.undo_image.borrow_mut().remove(0);
            self.undo_pos.set(self.undo_pos.get()-1);
        }
    }
pub fn undo_save ( & self ) { let image = self . image . borrow_mut ( ) ; self . undo_image . borrow_mut ( ) . push ( image . clone ( ) ) ; // prevents undo stack to grow too much!! self . undo_pos . set ( self . undo_pos . get ( ) + 1 ) ; if self . undo_image . borrow_mut ( ) . len ( ) > UNDODEPTH { self . undo_image . borrow_mut ( ) . remove ( 0 ) ; self . undo_pos . set ( self . undo_pos . get ( ) - 1 ) ; } }
save image state to undo stack
save image state to undo stack
&self
&self