touching变量移入SCN模块
修复iOS上经常卡掉第一个触摸导致后续不能和控件交互
This commit is contained in:
@@ -71,7 +71,6 @@ local xOy=SCR.xOy
|
||||
local ITP=xOy.inverseTransformPoint
|
||||
|
||||
local mx,my,mouseShow=-20,-20,false
|
||||
local touching--First touching ID(userdata)
|
||||
joysticks={}
|
||||
|
||||
local devMode
|
||||
@@ -181,8 +180,8 @@ end
|
||||
function love.touchpressed(id,x,y)
|
||||
mouseShow=false
|
||||
if SCN.swapping then return end
|
||||
if not touching then
|
||||
touching=id
|
||||
if not SCN.mainTouchID then
|
||||
SCN.mainTouchID=id
|
||||
WIDGET.unFocus(true)
|
||||
love.touchmoved(id,x,y,0,0)
|
||||
end
|
||||
@@ -201,12 +200,12 @@ end
|
||||
function love.touchreleased(id,x,y)
|
||||
if SCN.swapping then return end
|
||||
x,y=ITP(xOy,x,y)
|
||||
if id==touching then
|
||||
if id==SCN.mainTouchID then
|
||||
WIDGET.press(x,y,1)
|
||||
WIDGET.release(x,y)
|
||||
WIDGET.cursorMove(x,y)
|
||||
WIDGET.unFocus()
|
||||
touching=false
|
||||
SCN.mainTouchID=false
|
||||
end
|
||||
if SCN.touchUp then SCN.touchUp(x,y)end
|
||||
if(x-lastX)^2+(y-lastY)^2<62 then
|
||||
|
||||
Reference in New Issue
Block a user