Skip to content

Commit

Permalink
Small 1.6 fixes
Browse files Browse the repository at this point in the history
- added basalt.forceRenderUpdate
- fixed dropdowns behaving wrong on monitors
  • Loading branch information
NoryiE committed Apr 29, 2023
1 parent d693141 commit 075903f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Basalt/Frame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -885,20 +885,20 @@ return function(name, parent, pTerm, basalt)
end
end,

mouseHandler = function(self, button, x, y, _, side)
mouseHandler = function(self, button, x, y, touch, side)
if(isGroupedMonitor)then
if(termObject.calculateClick~=nil)then
x, y = termObject.calculateClick(side, x, y)
end
end
if(base.mouseHandler(self, button, x, y))then
if(base.mouseHandler(self, button, x, y, touch))then
if(events["mouse_click"]~=nil)then
self:setCursor(false)
for _, index in ipairs(eventZIndex["mouse_click"]) do
if (events["mouse_click"][index] ~= nil) then
for _, value in rpairs(events["mouse_click"][index]) do
if (value.mouseHandler ~= nil) then
if (value:mouseHandler(button, x, y)) then
if (value:mouseHandler(button, x, y, touch)) then

return true
end
Expand Down
4 changes: 4 additions & 0 deletions Basalt/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@ basalt = {
projectDirectory = dir
end,

forceRenderUpdate = function()
drawFrames()
end,

debug = function(...)
local args = { ... }
if(mainFrame==nil)then print(...) return end
Expand Down
5 changes: 4 additions & 1 deletion Basalt/objects/Dropdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ return function(name)
return dropdownW, dropdownH
end,

mouseHandler = function(self, button, x, y)
mouseHandler = function(self, button, x, y, touch)
if (isOpened) then
local obx, oby = self:getAbsolutePosition(self:getAnchorPosition())
if(button==1)then
Expand All @@ -135,6 +135,9 @@ return function(name)
self:setValue(list[n + yOffset])
self:updateDraw()
local val = self:getEventSystem():sendEvent("mouse_click", self, "mouse_click", dir, x, y)
if(touch)then
self:mouseUpHandler(button, x, y)
end
if(val==false)then return val end
return true
end
Expand Down

0 comments on commit 075903f

Please sign in to comment.