Skip to content

Commit

Permalink
Fixed visual bugs with brushes and fast mouse clicks
Browse files Browse the repository at this point in the history
Reproducable with mouse keys (used incorrectly) to produce two clicks in rapid succession
Causes the rectangle tool to first place the preview then a 1x1 at the start
The 1x1 used 0 as fallback for missing data instead of " ", resulting in it "deleting" the visuals
  • Loading branch information
Cruor committed Jan 25, 2022
1 parent 2ebd829 commit de55cfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/brushes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function brushHelper.updateRender(room, x, y, material, layer, randomMatrix)
local tx, ty = x + i - 1, y + j - 1

if tx >= 1 and ty >= 1 and tx <= tilesWidth and ty <= tilesHeight then
local target = tilesMatrix:get(tx, ty, "0")
local target = tilesMatrix:get(tx, ty, " ")
local mat = material:getInbounds(i, j)

if mat ~= target and mat ~= " " then
Expand Down

0 comments on commit de55cfd

Please sign in to comment.