Add Right Shift Alignment

This commit is contained in:
GreenComfyTea
2023-05-28 17:40:10 +03:00
parent 5af7f53962
commit c56976b97f
9 changed files with 1603 additions and 240 deletions

View File

@@ -126,12 +126,19 @@ function this.draw_label(label, position, opacity_scale, ...)
return;
end
local text = string.format(label.text_format, table.unpack({...}));
local text = string.format(label.text_formatting, table.unpack({...}));
if text == "" then
return;
end
local right_alignment_shift = label.settings.right_alignment_shift;
if right_alignment_shift ~= 0 then
local right_aligment_format = string.format("%%%ds", right_alignment_shift);
text = string.format(right_aligment_format, text);
end
local position_x = position.x + label.offset.x;
local position_y = position.y + label.offset.y;