forked from pyrex/chameleonic
catch up to latest developments #10
@ -986,17 +986,17 @@ function rope:draw(artificial_dx,artificial_dy)
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
for i=0,#self.ancs+1 do
|
||||
p=self:_anc(i)
|
||||
local c=12
|
||||
if (p.dirty) c=13
|
||||
rectfill(p.x-1,p.y-1,p.x+1,p.y+1,c)
|
||||
print(tostr(p.id)..":"..p.x..","..p.y..","..#p.todo,0,-8+i*8,9)
|
||||
print(tostr(p.id)..":"..p.x..","..p.y..","..#p.todo,0,i*8,9)
|
||||
end
|
||||
for _,p in pairs(level._anch) do
|
||||
pset(p.x,p.y,11)
|
||||
end
|
||||
--[[
|
||||
print("dirty:"..tostr(self.dirty),32,0,9)
|
||||
print("busy:"..tostr(self:busy()),32,7,9)
|
||||
print("state:"..tostr(self.state.name),32,14,9)
|
||||
@ -1168,6 +1168,7 @@ function rope:_find_needed_anchors(i,busy)
|
||||
end
|
||||
end
|
||||
|
||||
local ELIDE_POINT=0.01
|
||||
function rope:_find_touched_anchors(i)
|
||||
if (i<=0) return false
|
||||
if (#self.ancs<i) return false
|
||||
@ -1182,7 +1183,7 @@ function rope:_find_touched_anchors(i)
|
||||
local a1=level:point_anchor(bx,by)
|
||||
if
|
||||
a1!=nil and not _point_eq(a0,a1) and not _point_eq(a1,a2)
|
||||
and _linedist(a0,a1,a2) == 0.0
|
||||
and _linedist(a0,a1,a2)<ELIDE_POINT
|
||||
-- and self:_can_stretch(p,a2)
|
||||
then
|
||||
local id=self.id
|
||||
@ -1207,7 +1208,7 @@ function rope:_elide_point(i,busy)
|
||||
if _point_eq(a0,a1) or _point_eq(a1,a2) or (not busy and level_anc==nil) then
|
||||
-- do it unconditionally
|
||||
else
|
||||
if _linedist(a0,a1,a2) < 0.01 then
|
||||
if _linedist(a0,a1,a2) < ELIDE_POINT then
|
||||
return false
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user