After noodling about it for a few days, this seems like an improvement:
When I "pick up" a node it's above the surface and doesn't disturb other nodes until I "put it down".
There's a shadow around the node as I move it around, showing what is likely to be disturbed when I put it down.
If I put down really close to where I picked up, it's considered an undo and no collisions are resolved.
There's a hint around the original location to help me put it back there.
PMAUMC7DNSQUUKKJW3DPNAFMSSBQBJJCYKWZFDTTCU6ZPXG5S5HQC
TAOVHUDMSPGIUIYWRQAY7WOBPEKWXFI5BQW5DAIFXL3I3GP2QYYQC
OIZB23GPQYDKBIZPB2TXBDQCJCWQUCWUX3SWPGHXY5HXNVQABBYQC
PWHCP7IRC6ATMTYMXUAJCEEBX2FZN4P5S22ZI4ZS2YA3D7IJ7PYAC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
B3I5MC55KGDCKCCC6VTSZXCTMWULONPWPBL6PKBME7TOCODWONDQC
RKCJBAJPRQAB3PYHETZFU6347F5YQXWYRMDNSVJINLY2EK2DE4EAC
SUPHTPXYKS4JBDPASHAYA5OBVJ45QT7ZV2HYNTF7OJYOKKS6DW5QC
JIBCE66ZTWM5WEHEHNKKTRWBJQSQWBDDWPMOJIJR5Q676OSHYCNAC
7KX3WBFEXMIHNKWNF4NUOBW5HO3PEL3ZEFFMTAXFOQG6V7BYXZ3AC
7TQAF4BYIK75EEYCCK7VEUSZHNCWMWIA3HZGQKIILYESUZ5ZZRVQC
FBDRJ53NJ5BWDQGU2GWZ6NEYHKCCRD7RODMIG7QQZBRFUB4HR7OAC
OELP2MAL5RGZ3AZ42V6H7RLGX52JLNHGUD7GV6YIVZ3ACOK5SFSQC
draw_move_node_shadow = function()
love.graphics.rectangle('fill',
vx(Move.node.pos.x-Move.node.hs.x),
vy(Move.node.pos.y-Move.node.hs.y),
scale(Move.node.hs.x*2),
scale(Move.node.hs.y*2))
end
dist = function(x1,y1, x2,y2)
return ((x2-x1)^2+(y2-y1)^2)^0.5
end
end
-- some hacky stuff outside of LuaML
if Move then
-- a hint for original location of node, to help put it back
App.color{r=0.8, g=0.8, b=0.8}
love.graphics.rectangle('fill', vx(Move.oldx), vy(Move.oldy), scale(Move.node.w), scale(Move.node.h))
-- a hint about the amount of padding we're going to clear when we set the node down
draw_move_node_shadow()
Move.node.pos.x = Move.node.x+Move.node.hs.x
Move.node.pos.y = Move.node.y+Move.node.hs.y
move_others(Move.node)
Move.node.pos.x = Move.node.x+Move.node.w/2
Move.node.pos.y = Move.node.y+Move.node.h/2+30
-- resolve collisions unless I'm trying to put it back carefully where I started.
if dist(vx(Move.node.x), vy(Move.node.y), vx(Move.oldx), vy(Move.oldy)) > 10 then
Move.node.pos.x = Move.node.x+Move.node.hs.x
Move.node.pos.y = Move.node.y+Move.node.hs.y
move_others(Move.node)
end