Skip to content

Commit bb7f794

Browse files
committed
Fixed crash with rendering tile selections
1 parent b99f32a commit bb7f794

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/tools/selection.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,15 @@ local function drawSelectionRectanglesCommon(room, targets, borderColor, fillCol
244244
local x, y = target.x, target.y
245245
local width, height = target.width, target.height
246246

247-
alreadyDrawn[target.item] = alreadyDrawn[target.item] or {}
247+
local item = target.item
248+
local node = target.node or 0
248249

249-
if not alreadyDrawn[target.item][target.node] then
250+
alreadyDrawn[item] = alreadyDrawn[item] or {}
251+
252+
if not alreadyDrawn[item][node] then
250253
love.graphics.rectangle("line", x - lineWidth / 2, y - lineWidth / 2, width + lineWidth, height + lineWidth)
251254

252-
alreadyDrawn[target.item][target.node] = true
255+
alreadyDrawn[item][node] = true
253256
end
254257
end
255258
end)

0 commit comments

Comments
 (0)