Update to current project state #1

Merged
kistaro merged 6 commits from pyrex/chameleonic:main into main 2022-12-17 22:16:05 +00:00
Showing only changes of commit 13e6c382be - Show all commits

View File

@ -967,34 +967,27 @@ function rope:_rast(
if (y0<y1) sy=1
local done=false,err
local queue={}
if dx>dy then
err=dx/2.0
return function()
if (queue==nil) return
if (x==x1) queue=nil return x1,y1
if #queue==0 then
add(queue,{x,y})
err-=dy
if (err<0) y+=sy add(queue,{x,y}) err+=dx
x+=sx
end
return unpack(deli(queue,1))
if (done) return
if (x==x1) done=true return x1,y1
local oldx,oldy=x,y
err-=dy
if (err<0) y+=sy err+=dx
x+=sx
return oldx,oldy
end
else
err=dy/2.0
return function()
if (queue==nil) return
if (y==y1) queue=nil return x1,y1
if #queue==0 then
add(queue,{x,y})
local oldx,oldy=x,y
err-=dx
if (err<0) x+=sx add(queue,{x,y}) err+=dy
y+=sy
end
return unpack(deli(queue,1))
if (done) return
if (y==y1) done=true return x1,y1
local oldx,oldy=x,y
err-=dx
if (err<0) x+=sx err+=dy
y+=sy
return oldx,oldy
end
end
end