From 3227d17266ac7c836e0df995c1e38d5cfbab0be7 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Thu, 9 Nov 2023 16:56:33 -0500 Subject: [PATCH] Change how console scaling works --- src/pc/djui/djui_console.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/pc/djui/djui_console.c b/src/pc/djui/djui_console.c index 7090a905..12f40a69 100644 --- a/src/pc/djui/djui_console.c +++ b/src/pc/djui/djui_console.c @@ -12,7 +12,7 @@ char gDjuiConsoleTmpBuffer[CONSOLE_MAX_TMP_BUFFER] = ""; u32 sDjuiConsoleMessages = 0; bool djui_console_render(struct DjuiBase* base) { - djui_base_set_size(base, gDjuiRoot->base.width.value, gDjuiRoot->base.height.value * 0.6f); + djui_base_set_size(base, gDjuiRoot->base.width.value, gDjuiRoot->base.height.value * 0.5f); djui_rect_render(base); return true; @@ -28,12 +28,6 @@ void djui_console_toggle(void) { gDjuiConsoleFocus = !gDjuiConsoleFocus; djui_base_set_visible(&gDjuiConsole->base, gDjuiConsoleFocus); - u32 windowWidth, windowHeight; - wm_api->get_dimensions(&windowWidth, &windowHeight); - f32 scaledHeight = (windowHeight * 0.6f) / djui_gfx_get_scale(); - - djui_base_set_size(&gDjuiConsole->base, 1, MIN(scaledHeight, 1000)); - if (gDjuiConsoleFocus) { if (gDjuiChatBoxFocus) { djui_chat_box_toggle(); } djui_interactable_set_input_focus(&gDjuiConsole->base); @@ -123,7 +117,7 @@ struct DjuiConsole* djui_console_create(void) { djui_base_init(NULL, base, djui_console_render, djui_console_destroy); djui_base_set_size_type(base, DJUI_SVT_ABSOLUTE, DJUI_SVT_ABSOLUTE); - djui_base_set_size(base, gDjuiRoot->base.width.value, 1000); + djui_base_set_size(base, gDjuiRoot->base.width.value, gDjuiRoot->base.height.value * 0.5f); djui_base_set_alignment(base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP); djui_base_set_color(base, 0, 0, 0, 220); djui_base_set_padding(base, 0, 8, 8, 8);