Skip to content
Snippets Groups Projects
Commit f8dbad70 authored by Fabian Heinrich's avatar Fabian Heinrich
Browse files

GUI: if only 1 item is inside cooking equipment: Dont resize and put it in the middle

parent ffb81cfd
No related branches found
No related tags found
1 merge request!19Resolve "Add recipe yaml check + visualize recipes"
Pipeline #43952 failed
......@@ -36,7 +36,7 @@ class MenuStates(Enum):
def create_polygon(n, length):
if n == 0:
if n == 1:
return np.array([0, 0])
vector = np.array([length, 0])
......@@ -411,9 +411,10 @@ class PyGameGUI:
if isinstance(item, CookingEquipment) and item.content_list:
if isinstance(item.content_list, list):
triangle_offsets = create_polygon(len(item.content_list), length=10)
scale = 1 if len(item.content_list) == 1 else 0.6
for idx, o in enumerate(item.content_list):
triangle_offsets = create_polygon(len(item.content_list), length=10)
self.draw_item(pos + triangle_offsets[idx], o, scale=0.6)
self.draw_item(pos + triangle_offsets[idx], o, scale=scale)
elif item.name in self.visualization_config:
self.draw_thing(pos, self.visualization_config[item.name]["parts"])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment