Set bar_size to nil in progress_bar again

See the lengthy comment to learn why
This commit is contained in:
Wuzzy 2019-09-13 19:56:22 +02:00
parent 48d9fd6a12
commit 1e3def3cfa

@ -228,7 +228,13 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta
local bar_image, bar_size
if hb.settings.bar_type == "progress_bar" then
bar_image = textures.bar
bar_size = {x=2, y=16}
-- NOTE: Intentionally set to nil. For some reason, on some systems,
-- the progress bar is displaced when the bar_size is set explicitly here.
-- On the other hand, setting this to nil is deprecated in MT 5.0.0 due to
-- a debug log warning, but nothing is explained in lua_api.txt.
-- This section is a potential bug magnet, please watch with care!
-- The size of the bar image is expected to be exactly 2×16 pixels.
bar_size = nil
elseif hb.settings.bar_type == "statbar_classic" or hb.settings.bar_type == "statbar_modern" then
bar_image = textures.icon
bar_size = {x=24, y=24}