From 9f3550adbc16fb05eb7ad34fa410a146211f91ef Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 27 May 2021 10:07:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A7=E4=BB=B6=E6=A8=A1=E5=9D=97=E4=B8=80?= =?UTF-8?q?=E5=A4=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/widget.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Zframework/widget.lua b/Zframework/widget.lua index 26ed726d..a7d66b62 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -531,8 +531,8 @@ function slider:drag(x) end end function slider:release(x) - self.lastTime=0 self:drag(x) + self.lastTime=0 end function slider:arrowKey(isLeft) local p=self.disp() @@ -1116,9 +1116,10 @@ function WIDGET.cursorMove(x,y) end function WIDGET.press(x,y,k) local W=WIDGET.sel - if not W then return end - W:press(x,y+WIDGET.scrollPos,k) - if W.hide then WIDGET.unFocus()end + if W then + W:press(x,y and y+WIDGET.scrollPos,k) + if W.hide then WIDGET.unFocus()end + end end function WIDGET.drag(x,y,dx,dy) if WIDGET.sel then @@ -1134,8 +1135,7 @@ function WIDGET.drag(x,y,dx,dy) end function WIDGET.release(x,y) local W=WIDGET.sel - if not W then return end - if W.type=='slider'then + if W and W.type=='slider'then W:release(x,y+WIDGET.scrollPos) end end