From 02f118d025a75f60b33cfee6bd8cd8d45ece2c07 Mon Sep 17 00:00:00 2001 From: 2lag <96544487+2lag@users.noreply.github.com> Date: Mon, 10 Aug 2026 19:35:23 +0200 Subject: fix the gay --- src/gui/contextmenu.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/gui/contextmenu.cpp') diff --git a/src/gui/contextmenu.cpp b/src/gui/contextmenu.cpp index 73cbafd..0775651 100644 --- a/src/gui/contextmenu.cpp +++ b/src/gui/contextmenu.cpp @@ -119,11 +119,11 @@ static void gui_contextmenu_draw_rows( U8 left_down ) { I32 item_count = (I32)menu->items->size; - I32 first = m_clamp( + I32 first = m_clamp( menu->first_visible, 0, item_count ); - I32 rows = min( + I32 rows = min( menu->visible_rows, item_count - first ); @@ -133,8 +133,8 @@ static void gui_contextmenu_draw_rows( gui_draw_push_clip( x + 1, y, - max( 0, menu->w - 2 ), - max( 0, rows * gui_contextmenu_row_h() ) + max( 0, menu->w - 2 ), + max( 0, rows * gui_contextmenu_row_h() ) ); for( I32 row = 0; row < rows; ++row ) { @@ -154,7 +154,7 @@ static void gui_contextmenu_draw_rows( gui_draw_frect( x + 1, row_y, - max( 1, menu->w - 2 ), + max( 1, menu->w - 2 ), gui_contextmenu_row_h(), fill ); @@ -225,7 +225,7 @@ void gui_contextmenu_input_fn( void* ptr ) { return; if( hit == -1 ) { - gui_hide_contextmenu( menu ); + gui_contextmenu_hide( menu ); return; } @@ -239,7 +239,7 @@ void gui_contextmenu_input_fn( void* ptr ) { if( parent && parent->children.idx_of( (GUI_BASE*)menu ) != -1 - ) gui_hide_contextmenu( menu ); + ) gui_contextmenu_hide( menu ); return; } } @@ -248,7 +248,7 @@ void gui_contextmenu_input_fn( void* ptr ) { menu->held_idx = -1; } -void gui_hide_contextmenu( GUI_CONTEXTMENU* menu ) { +void gui_contextmenu_hide( GUI_CONTEXTMENU* menu ) { if( !menu ) return; @@ -349,11 +349,11 @@ void gui_contextmenu_reveal_selection( else if( selected >= menu->first_visible + menu->visible_rows ) menu->first_visible = selected - menu->visible_rows + 1; - I32 max_first = max( 0, + I32 max_first = max( 0, (I32)menu->items->size - menu->visible_rows ); - menu->first_visible = m_clamp( + menu->first_visible = m_clamp( menu->first_visible, 0, max_first ); @@ -396,7 +396,7 @@ GUI_CONTEXTMENU* gui_show_contextmenu( return 0; if( owner_ref && *owner_ref ) - gui_hide_contextmenu( *owner_ref ); + gui_contextmenu_hide( *owner_ref ); GUI_CONTEXTMENU* menu = new GUI_CONTEXTMENU; menu->items = items; @@ -411,10 +411,10 @@ GUI_CONTEXTMENU* gui_show_contextmenu( menu->owner_ref = owner_ref; I32 item_count = (I32)items->size; menu->max_visible_rows = max_visible_rows > 0 - ? min( max_visible_rows, item_count ) + ? min( max_visible_rows, item_count ) : item_count; menu->visible_rows = menu->max_visible_rows; - menu->first_visible = max( 0, + menu->first_visible = max( 0, item_count - menu->visible_rows ); -- cgit v1.2.3