main #12

Merged
kistaro merged 20 commits from pyrex/chameleonic:main into main 2022-12-23 06:38:45 +00:00
Showing only changes of commit 2d565873b3 - Show all commits

View File

@ -60,12 +60,11 @@ function linefill(ax,ay,bx,by,r,c)
local ca,sa=dx/d,-dy/d local ca,sa=dx/d,-dy/d
-- polygon points -- polygon points
local s={{0,-r},{d,-r},{d,r},{0,r}}
local spans={} local spans={}
local function calcxy(u,v) return ax+u*ca+v*sa,ay-u*sa+v*ca end local function calcxy(u,v) return ax+u*ca+v*sa,ay-u*sa+v*ca end
local x0,y0=calcxy(0,r) local x0,y0=calcxy(0,r)
for i=1,4 do for s in all{{0,-r},{d,-r},{d,r},{0,r}} do
local x1,y1=calcxy(unpack(s[i])) local x1,y1=calcxy(unpack(s))
local _x1,_y1=x1,y1 local _x1,_y1=x1,y1
if(y0>y1) x0,y0,x1,y1=x1,y1,x0,y0 if(y0>y1) x0,y0,x1,y1=x1,y1,x0,y0
local dx=(x1-x0)/(y1-y0) local dx=(x1-x0)/(y1-y0)