Paint.ImageStateData.IncrementSavePoint C# (CSharp) Method

IncrementSavePoint() public method

Increments the save point by one - but taking into account wrapping back to zero
public IncrementSavePoint ( ) : void
return void
        public void IncrementSavePoint()
        {
            if (++this.CurrentSavePoint == this.MaxUndoRedoCount)
            {
                this.CurrentSavePoint = 0;
            }

            if (this.CurrentSavePoint == this.FirstSavePoint)
            {
                // we've wrapped round to start re-using the buffer space so we need to move the firstSavePoint on one
                // as well to ensure we don't loop too far when undoing the changes
                if (++this.FirstSavePoint == this.MaxUndoRedoCount)
                {
                    this.FirstSavePoint = 0;
                }
            }
        }