调整listBox的drawF参数顺序

This commit is contained in:
MrZ626
2021-06-26 21:37:38 +08:00
parent 4809d4193e
commit ce91e75cd2
2 changed files with 2 additions and 2 deletions

View File

@@ -1145,7 +1145,7 @@ function listBox:draw()
local pos=int(scrollPos/lineH)
gc_translate(0,-(scrollPos%lineH))
for i=pos+1,min(pos+cap+1,#list)do
self.drawF(i==self.selected,i,list[i])
self.drawF(list[i],i,i==self.selected)
gc_translate(0,lineH)
end
gc_setStencilTest()

View File

@@ -16,7 +16,7 @@ local compatibleVer={
"V0.15.5",
}
local roomList=WIDGET.newListBox{name="roomList",x=50,y=50,w=800,h=440,lineH=40,drawF=function(ifSel,id,item)
local roomList=WIDGET.newListBox{name="roomList",x=50,y=50,w=800,h=440,lineH=40,drawF=function(item,id,ifSel)
setFont(35)
if ifSel then
gc_setColor(1,1,1,.3)