Skip to content

Commit 075903f

Browse files
committed
Small 1.6 fixes
- added basalt.forceRenderUpdate - fixed dropdowns behaving wrong on monitors
1 parent d693141 commit 075903f

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Basalt/Frame.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -885,20 +885,20 @@ return function(name, parent, pTerm, basalt)
885885
end
886886
end,
887887

888-
mouseHandler = function(self, button, x, y, _, side)
888+
mouseHandler = function(self, button, x, y, touch, side)
889889
if(isGroupedMonitor)then
890890
if(termObject.calculateClick~=nil)then
891891
x, y = termObject.calculateClick(side, x, y)
892892
end
893893
end
894-
if(base.mouseHandler(self, button, x, y))then
894+
if(base.mouseHandler(self, button, x, y, touch))then
895895
if(events["mouse_click"]~=nil)then
896896
self:setCursor(false)
897897
for _, index in ipairs(eventZIndex["mouse_click"]) do
898898
if (events["mouse_click"][index] ~= nil) then
899899
for _, value in rpairs(events["mouse_click"][index]) do
900900
if (value.mouseHandler ~= nil) then
901-
if (value:mouseHandler(button, x, y)) then
901+
if (value:mouseHandler(button, x, y, touch)) then
902902

903903
return true
904904
end

Basalt/main.lua

+4
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,10 @@ basalt = {
436436
projectDirectory = dir
437437
end,
438438

439+
forceRenderUpdate = function()
440+
drawFrames()
441+
end,
442+
439443
debug = function(...)
440444
local args = { ... }
441445
if(mainFrame==nil)then print(...) return end

Basalt/objects/Dropdown.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ return function(name)
124124
return dropdownW, dropdownH
125125
end,
126126

127-
mouseHandler = function(self, button, x, y)
127+
mouseHandler = function(self, button, x, y, touch)
128128
if (isOpened) then
129129
local obx, oby = self:getAbsolutePosition(self:getAnchorPosition())
130130
if(button==1)then
@@ -135,6 +135,9 @@ return function(name)
135135
self:setValue(list[n + yOffset])
136136
self:updateDraw()
137137
local val = self:getEventSystem():sendEvent("mouse_click", self, "mouse_click", dir, x, y)
138+
if(touch)then
139+
self:mouseUpHandler(button, x, y)
140+
end
138141
if(val==false)then return val end
139142
return true
140143
end

0 commit comments

Comments
 (0)