mirror of https://github.com/odrling/Aegisub
Minor fixes to Lua includes.
Originally committed to SVN as r1428.
This commit is contained in:
parent
52904f6217
commit
42f47ed7eb
|
@ -34,7 +34,7 @@ module("unicode")
|
||||||
|
|
||||||
-- Return the number of bytes occupied by the character starting at the i'th byte in s
|
-- Return the number of bytes occupied by the character starting at the i'th byte in s
|
||||||
function charwidth(s, i)
|
function charwidth(s, i)
|
||||||
local b = s:byte(i)
|
local b = s:byte(i or 1)
|
||||||
if not b then
|
if not b then
|
||||||
--aegisub.debug.out(3, "unicode.charwidth of '%s' @ %d, nil byte\n", s, i)
|
--aegisub.debug.out(3, "unicode.charwidth of '%s' @ %d, nil byte\n", s, i)
|
||||||
-- FIXME, something in karaskel results in this case, shouldn't happen
|
-- FIXME, something in karaskel results in this case, shouldn't happen
|
||||||
|
|
|
@ -107,13 +107,13 @@ end
|
||||||
-- Create an alpha override code from a style definition colour code
|
-- Create an alpha override code from a style definition colour code
|
||||||
function alpha_from_style(scolor)
|
function alpha_from_style(scolor)
|
||||||
local r, g, b, a = extract_color(scolor)
|
local r, g, b, a = extract_color(scolor)
|
||||||
return ass_alpha(a)
|
return ass_alpha(a or 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Create an colour override code from a style definition colour code
|
-- Create an colour override code from a style definition colour code
|
||||||
function color_from_style(scolor)
|
function color_from_style(scolor)
|
||||||
local r, g, b = extract_color(scolor)
|
local r, g, b = extract_color(scolor)
|
||||||
return ass_color(r, g, b)
|
return ass_color(r or 0, g or 0, b or 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Converts HSV (Hue, Saturation, Value) to RGB
|
-- Converts HSV (Hue, Saturation, Value) to RGB
|
||||||
|
|
Loading…
Reference in New Issue