Fixed one stupid rendering bug...

This commit is contained in:
Ognjen Milan Robovic 2024-05-12 11:08:32 -04:00
parent adfae1a0ac
commit 2925dc0b95
2 changed files with 28 additions and 2 deletions

View File

@ -263,7 +263,7 @@ package body core is
end loop; end loop;
-- --
if width mod data.width > 0 then 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 if;
end draw_horizontally; end draw_horizontally;
@ -276,7 +276,7 @@ package body core is
end loop; end loop;
-- --
if height mod data.height > 0 then 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 if;
end draw_vertically; end draw_vertically;

View File

@ -281,6 +281,8 @@ package body ui is
core.zoom := save_zoom; core.zoom := save_zoom;
-- --
if core.cursor_inside (x, y, core.icon / core.zoom, core.icon / core.zoom) then if core.cursor_inside (x, y, core.icon / core.zoom, core.icon / core.zoom) then
prioritize := true;
--
draw (icon_selected, x, y); draw (icon_selected, x, y);
-- --
core.write_help_box (text); 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 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; offset : constant integer := sprite (active, text_middle).width;
begin 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_background (text_middle, x + offset, y + offset, width - 2 * offset, height - 2 * offset);
-- --
draw_horizontally (text_upper, x + offset, y, width - 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); 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 if core.cursor_inside (x, y, width / core.zoom, height / core.zoom) then
prioritize := true;
--
core.write_help_box (description); core.write_help_box (description);
-- --
if core.cursor_mode = 1 then 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 font_tint (active) else (others => 255)));
-- --
if core.cursor_inside (x, y, width / core.zoom, height / core.zoom) then if core.cursor_inside (x, y, width / core.zoom, height / core.zoom) then
prioritize := true;
--
if core.cursor_mode = 1 then if core.cursor_mode = 1 then
action.all; action.all;
core.cursor_mode := 0; 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; 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; offset : constant integer := (sprite (active, title_bar_middle).height - font (active).scale) / 2;
begin 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_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); 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 procedure draw_menu (x, y, width, height : in integer) is
offset : constant integer := sprite (active, none).width; offset : constant integer := sprite (active, none).width;
begin 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; 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; 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; 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 procedure draw_tiny_menu (x, y, width, height : in integer) is
offset : constant integer := sprite (active, none).width; offset : constant integer := sprite (active, none).width;
begin 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); 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; 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_x : constant integer := sprite (active, icon_upper_left).width;
offset_y : constant integer := sprite (active, icon_upper_left).height; offset_y : constant integer := sprite (active, icon_upper_left).height;
begin 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 if height < 2 * sprite (active, icon_upper_left).height
or width < 2 * sprite (active, icon_upper_left).width then or width < 2 * sprite (active, icon_upper_left).width then
return; return;