File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1795,14 +1795,18 @@ DimensionsOverlay.ATTRS{
1795
1795
local selection_rect = df .global .selection_rect
1796
1796
1797
1797
local function is_choosing_area ()
1798
- return selection_rect .start_x >= 0 and dfhack .gui .getMousePos ()
1798
+ return selection_rect .start_z >= 0 and dfhack .gui .getMousePos (true )
1799
1799
end
1800
1800
1801
1801
local function get_cur_area_dims ()
1802
- local pos1 = dfhack .gui .getMousePos ()
1803
- if not pos1 or selection_rect .start_x < 0 then return 1 , 1 , 1 end
1802
+ local pos1 = dfhack .gui .getMousePos (true )
1803
+ if not pos1 or selection_rect .start_z < 0 then return 1 , 1 , 1 end
1804
1804
1805
1805
-- clamp to map edges (since you can start selection out of bounds)
1806
+ pos1 = xyz2pos (
1807
+ math.max (0 , math.min (df .global .world .map .x_count - 1 , pos1 .x )),
1808
+ math.max (0 , math.min (df .global .world .map .y_count - 1 , pos1 .y )),
1809
+ math.max (0 , math.min (df .global .world .map .z_count - 1 , pos1 .z )))
1806
1810
local pos2 = xyz2pos (
1807
1811
math.max (0 , math.min (df .global .world .map .x_count - 1 , selection_rect .start_x )),
1808
1812
math.max (0 , math.min (df .global .world .map .y_count - 1 , selection_rect .start_y )),
You can’t perform that action at this time.
0 commit comments