From ce91e75cd2c67f8d0b32dd77561cf3b58535cdd4 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sat, 26 Jun 2021 21:37:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4listBox=E7=9A=84drawF?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/widget.lua | 2 +- parts/scenes/net_rooms.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Zframework/widget.lua b/Zframework/widget.lua index d45e50be..3f9b7d1b 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -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() diff --git a/parts/scenes/net_rooms.lua b/parts/scenes/net_rooms.lua index 08aaccff..7d41e9b6 100644 --- a/parts/scenes/net_rooms.lua +++ b/parts/scenes/net_rooms.lua @@ -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)