From cda04b245a896dbf3097b8066340ae1fb8d7045f Mon Sep 17 00:00:00 2001 From: xolatile Date: Mon, 19 Feb 2024 16:46:28 -0500 Subject: [PATCH] Added menu height limitation... --- source/menu.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/menu.adb b/source/menu.adb index 8b97848..a412ea1 100644 --- a/source/menu.adb +++ b/source/menu.adb @@ -35,8 +35,9 @@ package body menu is icon_offset : constant integer := 4; icon_size : constant integer := 32; offset : constant integer := icon_size + 2 * icon_offset; + limitation : constant integer := (if trait (index).length < trait (index).height then trait (index).length else trait (index).height); width : constant integer := 240; - height : constant integer := trait (index).length * offset + 2 * draw_offset; + height : constant integer := limitation * offset + 2 * draw_offset; -- offset_x : constant integer := (if center then (core.window_width - width) / 2 else x); offset_y : constant integer := (if center then (core.window_height - height) / 2 else y); @@ -48,7 +49,7 @@ package body menu is ui.draw_title_bar (offset_x, offset_y, width, trait (index).title); ui.draw_tiny_menu (offset_x, offset_y, width, height, true); -- - for element_index in 0 .. trait (index).length - 1 + for element_index in 0 .. limitation - 1 loop ui.draw_frame (offset_x + draw_offset, offset_y + draw_offset + element_index * offset, offset, offset); --