Some fix to previous commit

This commit is contained in:
Jean-Patrick Guerrero 2022-06-18 22:31:57 +02:00
parent a6605263f4
commit 8e45f303d3
2 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ local function cache_groups(groupname, groups)
if nb_items > 1 then
local px = 256
local sprite = fmt("[combine:%ux%u", px, nb_items + (px * nb_items) - 1)
local sprite = fmt("[combine:%ux%u", px, px * nb_items)
for i = 1, nb_items do
local item = items[i]
@ -43,7 +43,7 @@ local function cache_groups(groupname, groups)
texture = get_cube(def.tiles)
end
sprite = sprite .. fmt(":0,%u=%s", (i - 1) + ((i - 1) * px), texture)
sprite = sprite .. fmt(":0,%u=%s", (i - 1) * px, texture)
end
i3.groups[groupname].sprite = sprite

View File

@ -1035,7 +1035,7 @@ local function get_grid_fs(fs, data, rcp, is_recipe)
local sprite = group_cache.sprite
fs("item_image_button", X, Y, btn_size, btn_size, "", btn_name, "")
fs("animated_image", X + 0.01, Y, 1.87, 1.87, sprite, #group_cache.items, 1000)
fs("animated_image", X + 0.01, Y + 0.01, 1.89, 1.89, sprite, #group_cache.items, 1000)
fs("label", X + 0.45, Y + 0.18, label)
if _count > 1 then