Skip to content

Commit c7ab673

Browse files
committed
use same_xyz instead of comparing manually
1 parent 5c68802 commit c7ab673

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

gui/blueprint.lua

+5-6
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,12 @@ function BlueprintUI:onRenderBody()
123123
local _,x_start,x_end = min_to_max(self.mark.x, cursor.x, vp.x1, vp.x2)
124124
for y=y_start,y_end do for x=x_start,x_end do
125125
local pos = xyz2pos(x, y, cursor.z)
126-
if x == cursor.x and y == cursor.y then
127-
-- don't overwrite the cursor
128-
goto continue
126+
-- don't overwrite the cursor so the user can still tell where it is
127+
if not same_xyz(cursor, pos) then
128+
local stile = vp:tileToScreen(pos)
129+
dc:map(true):seek(stile.x, stile.y):
130+
pen(fg, bg):char('X'):map(false)
129131
end
130-
local stile = vp:tileToScreen(pos)
131-
dc:map(true):seek(stile.x, stile.y):pen(fg, bg):char('X'):map(false)
132-
::continue::
133132
end end
134133
end
135134
end

0 commit comments

Comments
 (0)