* Macro to correct errors in the internal SHIFT command * syntax : shift image x y * install by adding the following line to startup.cmd * cli rename shift old_shift * handle degenerate cases where x is 0 if $1 == 0 if $2 == 0 i= $0 else old_shift $0 0 $2 endif return endif * handle degenerate cases where y is 0 if $2 == 0 if $1 == 0 i= $0 else old_shift $0 $1 0 endif return endif * handle dual shift case vdef xs i.cols vdef ys i.rows vdef ci i.name icreate sh_tmp @xs @ys ci sh_tmp old_shift $0 $1 0 ci "@ci" old_shift sh_tmp 0 $2 iremove sh_tmp vkill xs ys ci