From aa681dad7c8182680feea1e1ffd1dffc69f6428c Mon Sep 17 00:00:00 2001 From: CadenCoaster Date: Fri, 24 Oct 2025 21:19:03 -0700 Subject: [PATCH] small fixes --- libs/window.lua | 2 ++ modules/interactions.lua | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/window.lua b/libs/window.lua index d4057c4..6672c5b 100644 --- a/libs/window.lua +++ b/libs/window.lua @@ -116,6 +116,7 @@ function lib.create(name, w, h, x, y, do_not_add) if y0 < 1 or y0 > t.h then return end for xi = 1, t.w do init_col(xi) + if not t.buffer[xi][y0] then t.buffer[xi][y0] = { char = " ", tc = t.textColor, bc = t.bgColor } end local cell = t.buffer[xi][y0] cell.char, cell.tc, cell.bc = " ", t.textColor, t.bgColor end @@ -191,6 +192,7 @@ function lib.create(name, w, h, x, y, do_not_add) local x = t.cursorX + i - 1 if x >= 1 and x <= t.w and y0 >= 1 and y0 <= t.h then init_col(x) + if not t.buffer[x][y0] then t.buffer[x][y0] = { char = " ", tc = t.textColor, bc = t.bgColor } end local cell = t.buffer[x][y0] cell.char = str:sub(i, i) cell.tc, cell.bc = t.textColor, t.bgColor diff --git a/modules/interactions.lua b/modules/interactions.lua index 0c470c3..02aecdc 100644 --- a/modules/interactions.lua +++ b/modules/interactions.lua @@ -56,6 +56,7 @@ while true do end end elseif data[1] == "mouse_drag" then + data[4] = math.max(data[4],2) if data[2] == 1 and dragging then if resizing then dragging.w = math.max(data[3] - dragging.x + 1,dragging.min_w) @@ -63,7 +64,7 @@ while true do threading.addThread(function()dragging.resized(dragging.w,dragging.h)end) else dragging.x = data[3] + offsetX - dragging.y = math.max(data[4],2) + offsetY + dragging.y = data[4] + offsetY end else for indx = #_G.windows, 1, -1 do