Don't crash when sizeUtf8Text is called on a nil

By returning a table with the right fields instead of nil.

Re #4845
pull/4852/head
NiLuJe 5 years ago
parent abbb3ea747
commit 9be3455ccc

@ -157,7 +157,7 @@ end
function RenderText:sizeUtf8Text(x, width, face, text, kerning, bold)
if not text then
logger.warn("sizeUtf8Text called without text");
return
return { x = 0, y_top = 0, y_bottom = 0 }
end
-- may still need more adaptive pen placement when kerning,

Loading…
Cancel
Save