SadConsole.Consoles.Cursor.LeftWrap C# (CSharp) Method

LeftWrap() public method

Moves the cusor left by the specified amount of columns, wrapping the cursor if needed.
public LeftWrap ( int amount ) : Cursor
amount int The amount of columns to move the cursor
return Cursor
        public Cursor LeftWrap(int amount)
        {
            var console = ((SurfaceEditor)_console.Target);

            int index = TextSurface.GetIndexFromPoint(this._position, console.TextSurface.Width) - amount;

            if (index < 0)
                index = 0;

            this._position = TextSurface.GetPointFromIndex(index, console.TextSurface.Width);

            return this;
        }