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