diff --git a/source/core.adb b/source/core.adb index e800cba..6f22494 100644 --- a/source/core.adb +++ b/source/core.adb @@ -263,7 +263,7 @@ package body core is end loop; -- if width mod data.width > 0 then - draw (data, x + (width / data.width) * data.width, y, width mod data.width, data.height); + draw (data, x + (width / data.width) * data.width, y, 0, 0, width mod data.width, data.height); end if; end draw_horizontally; @@ -276,7 +276,7 @@ package body core is end loop; -- if height mod data.height > 0 then - draw (data, x, y + (height / data.height) * data.height, data.width, height mod data.height); + draw (data, x, y + (height / data.height) * data.height, 0, 0, data.width, height mod data.height); end if; end draw_vertically; diff --git a/source/ui.adb b/source/ui.adb index 515c934..4c982c7 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -281,6 +281,8 @@ package body ui is core.zoom := save_zoom; -- if core.cursor_inside (x, y, core.icon / core.zoom, core.icon / core.zoom) then + prioritize := true; + -- draw (icon_selected, x, y); -- core.write_help_box (text); @@ -309,6 +311,10 @@ package body ui is procedure draw_help_box (x, y, width, height : in integer; action : core.pointer := core.idle_skip'access) is offset : constant integer := sprite (active, text_middle).width; begin + if core.cursor_inside (x, y, width, height) then + prioritize := true; + end if; + -- draw_background (text_middle, x + offset, y + offset, width - 2 * offset, height - 2 * offset); -- draw_horizontally (text_upper, x + offset, y, width - 2 * offset); @@ -349,6 +355,8 @@ package body ui is draw (frame_lower_right, x + width - sprite (active, frame_lower_right).width, y + height - sprite (active, frame_lower_right).height); -- if core.cursor_inside (x, y, width / core.zoom, height / core.zoom) then + prioritize := true; + -- core.write_help_box (description); -- if core.cursor_mode = 1 then @@ -372,6 +380,8 @@ package body ui is (if core.cursor_inside (x, y, width / core.zoom, height / core.zoom) then font_tint (active) else (others => 255))); -- if core.cursor_inside (x, y, width / core.zoom, height / core.zoom) then + prioritize := true; + -- if core.cursor_mode = 1 then action.all; core.cursor_mode := 0; @@ -399,6 +409,10 @@ package body ui is middle_width : constant integer := width - sprite (active, title_bar_left).width - sprite (active, title_bar_right).width; offset : constant integer := (sprite (active, title_bar_middle).height - font (active).scale) / 2; begin + if core.cursor_inside (x, y, width / core.zoom, sprite (active, title_bar_left).height / core.zoom) then + prioritize := true; + end if; + -- draw (title_bar_left, x, y - sprite (active, title_bar_left).height); draw (title_bar_right, x + middle_width + sprite (active, title_bar_left).width, y - sprite (active, title_bar_right).height); -- @@ -436,6 +450,10 @@ package body ui is procedure draw_menu (x, y, width, height : in integer) is offset : constant integer := sprite (active, none).width; begin + if core.cursor_inside (x, y, width / core.zoom, height / core.zoom) then + prioritize := true; + end if; + -- declare upper : constant integer := width - sprite (active, corner_upper_left).width - sprite (active, corner_upper_right).width; lower : constant integer := width - sprite (active, corner_lower_left).width - sprite (active, corner_lower_right).width; left : constant integer := height - sprite (active, corner_upper_left).height - sprite (active, corner_lower_left).height; @@ -458,6 +476,10 @@ package body ui is procedure draw_tiny_menu (x, y, width, height : in integer) is offset : constant integer := sprite (active, none).width; begin + if core.cursor_inside (x, y, width / core.zoom, height / core.zoom) then + prioritize := true; + end if; + -- draw_background (main_background, x + offset, y + offset, width - 2 * offset, height - 2 * offset); -- declare upper : constant integer := width - sprite (active, tiny_corner_upper_left).width - sprite (active, tiny_corner_upper_right).width; @@ -483,6 +505,10 @@ package body ui is offset_x : constant integer := sprite (active, icon_upper_left).width; offset_y : constant integer := sprite (active, icon_upper_left).height; begin + if core.cursor_inside (x, y, width / core.zoom, height / core.zoom) then + prioritize := true; + end if; + -- if height < 2 * sprite (active, icon_upper_left).height or width < 2 * sprite (active, icon_upper_left).width then return;