整理代码习惯,常量字符串改用单引号,可能有遗漏
This commit is contained in:
@@ -19,19 +19,19 @@ local cmds={
|
||||
|
||||
draw="draw",
|
||||
dLine="line",
|
||||
fRect=function(...)gc.rectangle("fill",...)end,
|
||||
dRect=function(...)gc.rectangle("line",...)end,
|
||||
fCirc=function(...)gc.circle("fill",...)end,
|
||||
dCirc=function(...)gc.circle("line",...)end,
|
||||
fPoly=function(...)gc.polygon("fill",...)end,
|
||||
dPoly=function(...)gc.polygon("line",...)end,
|
||||
fRect=function(...)gc.rectangle('fill',...)end,
|
||||
dRect=function(...)gc.rectangle('line',...)end,
|
||||
fCirc=function(...)gc.circle('fill',...)end,
|
||||
dCirc=function(...)gc.circle('line',...)end,
|
||||
fPoly=function(...)gc.polygon('fill',...)end,
|
||||
dPoly=function(...)gc.polygon('line',...)end,
|
||||
|
||||
dPie=function(...)gc.arc("line",...)end,
|
||||
dArc=function(...)gc.arc("line","open",...)end,
|
||||
dBow=function(...)gc.arc("line","closed",...)end,
|
||||
fPie=function(...)gc.arc("fill",...)end,
|
||||
fArc=function(...)gc.arc("fill","open",...)end,
|
||||
fBow=function(...)gc.arc("fill","closed",...)end,
|
||||
dPie=function(...)gc.arc('line',...)end,
|
||||
dArc=function(...)gc.arc('line','open',...)end,
|
||||
dBow=function(...)gc.arc('line','closed',...)end,
|
||||
fPie=function(...)gc.arc('fill',...)end,
|
||||
fArc=function(...)gc.arc('fill','open',...)end,
|
||||
fBow=function(...)gc.arc('fill','closed',...)end,
|
||||
}
|
||||
return function(L)
|
||||
gc.push()
|
||||
@@ -42,13 +42,13 @@ return function(L)
|
||||
gc.setLineWidth(1)
|
||||
for i=3,#L do
|
||||
local cmd=L[i][1]
|
||||
if type(cmd)=="boolean"and cmd then
|
||||
if type(cmd)=='boolean'and cmd then
|
||||
table.remove(L[i],1)
|
||||
cmd=L[i][1]
|
||||
end
|
||||
if type(cmd)=="string"then
|
||||
if type(cmd)=='string'then
|
||||
local func=cmds[cmd]
|
||||
if type(func)=="string"then func=gc[func]end
|
||||
if type(func)=='string'then func=gc[func]end
|
||||
if func then
|
||||
func(unpack(L[i],2))
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user