整理代码
This commit is contained in:
@@ -10,10 +10,10 @@ local VK=virtualkey
|
|||||||
local function onVirtualkey(x,y)
|
local function onVirtualkey(x,y)
|
||||||
local dist,nearest=1e10
|
local dist,nearest=1e10
|
||||||
for K=1,#VK do
|
for K=1,#VK do
|
||||||
local b=VK[K]
|
local B=VK[K]
|
||||||
if b.ava then
|
if B.ava then
|
||||||
local d1=(x-b.x)^2+(y-b.y)^2
|
local d1=(x-B.x)^2+(y-B.y)^2
|
||||||
if d1<b.r^2 then
|
if d1<B.r^2 then
|
||||||
if d1<dist then
|
if d1<dist then
|
||||||
nearest,dist=K,d1
|
nearest,dist=K,d1
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ end
|
|||||||
local function onVK_org(x,y)
|
local function onVK_org(x,y)
|
||||||
local dist,nearest=1e10
|
local dist,nearest=1e10
|
||||||
for K=1,#VK_org do
|
for K=1,#VK_org do
|
||||||
local b=VK_org[K]
|
local B=VK_org[K]
|
||||||
if b.ava then
|
if B.ava then
|
||||||
local d1=(x-b.x)^2+(y-b.y)^2
|
local d1=(x-B.x)^2+(y-B.y)^2
|
||||||
if d1<b.r^2 then
|
if d1<B.r^2 then
|
||||||
if d1<dist then
|
if d1<dist then
|
||||||
nearest,dist=K,d1
|
nearest,dist=K,d1
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user