Content deleted Content added
allow specifying height and width values as strings ending in px |
m Undid revision 611451330 by Mr. Stradivarius (talk) whoops, that edit was supposed to be to the sandbox... |
||
Line 5:
local fileLink = {}
local function checkTypeStringOrNum(funcName, pos, arg)▼
local argType = type(arg)▼
if argType ~= 'nil' and argType ~= 'string' and argType ~= 'number' then▼
error(string.format(▼
"bad argument #%d to '%s' (string or number expected, got %s)",▼
pos,▼
funcName,▼
argType▼
), 3)▼
end▼
end▼
function fileLink.new(filename)
Line 64 ⟶ 52:
end
local function
--
▲ error(string.format(
if px and data.isUpright then▼
error(string.format(▼
methodName
▲ "duplicate size argument detected in '%s' ('upright' cannot be"
▲ ), 3)
▲ .. ' used in conjunction with height or width)',
), 3)▼
end▼
end▼
end
function data:width(px)
checkSelf(self, 'width')
▲ if px and data.isUpright then
▲ end
data.theWidth = px
return self
Line 107 ⟶ 73:
function data:height(px)
checkSelf(self, 'height')
if px and data.isUpright then
▲ end
data.theHeight = px
return self
Line 217 ⟶ 185:
data.theLang = s
return self
▲ end
▲ local function checkTypeStringOrNum(funcName, pos, arg)
▲ error(string.format(
▲ "bad argument #%d to '%s' (string or number expected, got %s)",
▲ pos,
▲ funcName,
▲ argType
▲ ), 3)
end
|