rudimentary undo functionality
This commit is contained in:
parent
cd576ce19f
commit
e08f3c306d
1 changed files with 10 additions and 0 deletions
10
pixler.bas
10
pixler.bas
|
|
@ -140,6 +140,16 @@ do
|
|||
showcolorpicker=not showcolorpicker
|
||||
case "l"
|
||||
showcommands=not showcommands
|
||||
case chr$(26) ' Ctrl+Z
|
||||
if ubound(commands) > 3 then
|
||||
' Drop the trailing empty slot AND the last valid command
|
||||
redim _preserve commands(ubound(commands) - 2) as string
|
||||
|
||||
' Re-create the empty trailing slot required by addcommand
|
||||
redim _preserve commands(ubound(commands) + 1) as string
|
||||
|
||||
redraw
|
||||
end if
|
||||
end select
|
||||
|
||||
' 4. Draw everything using the freshly updated math
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue