From 38326bc3b697249f6cc3744b81912829ac6a1b28 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 13 May 2021 19:24:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E6=9C=AC=E6=A1=86?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E6=9C=89=E4=B8=80=E5=A4=84=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E7=9A=84=E6=8A=A5=E9=94=99=EF=BC=8C=E6=95=B4?= =?UTF-8?q?=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/widget.lua | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Zframework/widget.lua b/Zframework/widget.lua index e4f7f9ab..a42e4e8f 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -134,16 +134,6 @@ end function button:getCenter() return self.x+self.w*.5,self.y+self.h*.5 end -function button:FX() - local ATV=self.ATV - SYSFX.newRectRipple( - 6, - self.x-ATV, - self.y-ATV, - self.w+2*ATV, - self.h+2*ATV - ) -end function button:update() local ATV=self.ATV if WIDGET.sel==self then @@ -198,7 +188,14 @@ function button:getInfo() end function button:press(_,_,k) self.code(k) - self:FX() + local ATV=self.ATV + SYSFX.newRectRipple( + 6, + self.x-ATV, + self.y-ATV, + self.w+2*ATV, + self.h+2*ATV + ) if self.sound then SFX.play('button')end end function WIDGET.newButton(D)--name,x,y,w[,h][,fText][,color][,font=30][,sound=true][,align='M'][,edge=0],code[,hide] @@ -884,6 +881,7 @@ function textBox:push(t) end end function textBox:press(x,y) + if not(x and y)then return end self:drag(nil,nil,nil,0) if not self.fix and x>self.x+self.w-40 and y0 then