Skip to content
Extraits de code Groupes Projets
Valider 42f47ed7 rédigé par Niels Martin Hansen's avatar Niels Martin Hansen
Parcourir les fichiers

Minor fixes to Lua includes.

Originally committed to SVN as r1428.
parent 52904f62
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -34,7 +34,7 @@ module("unicode")
-- Return the number of bytes occupied by the character starting at the i'th byte in s
function charwidth(s, i)
local b = s:byte(i)
local b = s:byte(i or 1)
if not b then
--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
......
......@@ -107,13 +107,13 @@ end
-- Create an alpha override code from a style definition colour code
function alpha_from_style(scolor)
local r, g, b, a = extract_color(scolor)
return ass_alpha(a)
return ass_alpha(a or 0)
end
-- Create an colour override code from a style definition colour code
function color_from_style(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
-- Converts HSV (Hue, Saturation, Value) to RGB
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter