From 688884d06c04fdbc3322e24e864cd92d4fc3f5a8 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 22 Dec 2023 18:48:40 -0800 Subject: [PATCH] don't show padding when collisions won't happen Also don't show the undo hint when we're in the undo zone. Now things look unchanged when we're in the undo zone. Relax, nothing will change. --- 0026-on.draw | 4 ---- 0134-draw_move_node_shadow | 9 ++++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/0026-on.draw b/0026-on.draw index f238b8c..6f9801b 100644 --- a/0026-on.draw +++ b/0026-on.draw @@ -7,10 +7,6 @@ on.draw = function() 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() end for _,obj in ipairs(Surface) do diff --git a/0134-draw_move_node_shadow b/0134-draw_move_node_shadow index d55aa5a..72a5386 100644 --- a/0134-draw_move_node_shadow +++ b/0134-draw_move_node_shadow @@ -1,7 +1,14 @@ draw_move_node_shadow = function() - love.graphics.rectangle('fill', + if dist(vx(Move.node.x), vy(Move.node.y), vx(Move.oldx), vy(Move.oldy)) > 10 then + -- signal that a move will cause collisions + App.color{r=0.8, g=0.8, b=0.8} + 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)) + + -- show original location of node, to help put it back + love.graphics.rectangle('line', vx(Move.oldx), vy(Move.oldy), scale(Move.node.w), scale(Move.node.h)) + end end \ No newline at end of file