From 0ebe63eff31fc2e3276d8ad300f6d34c8d9b3c0a Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Sat, 27 Jul 2024 14:10:38 +0200 Subject: [PATCH] Misc --- src/platform/render_opengl.cpp | 2 +- src/text_editor/commands.cpp | 2 ++ src/text_editor/management.cpp | 4 +++- src/text_editor/text_editor.cpp | 1 - 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/platform/render_opengl.cpp b/src/platform/render_opengl.cpp index d0095ed..a22c827 100644 --- a/src/platform/render_opengl.cpp +++ b/src/platform/render_opengl.cpp @@ -371,7 +371,7 @@ void ReloadFont(int32_t size) { } Scratch scratch; - Atlas atlas = CreateAtlas(scratch, {1024, 1024}); + Atlas atlas = CreateAtlas(scratch, {2048, 2048}); MainFont = CreateFont(&atlas, size, FontPath); { glCreateTextures(GL_TEXTURE_2D, 1, &atlas.texture_id); diff --git a/src/text_editor/commands.cpp b/src/text_editor/commands.cpp index 15dc5fe..884b88d 100644 --- a/src/text_editor/commands.cpp +++ b/src/text_editor/commands.cpp @@ -328,8 +328,10 @@ bool GlobalCommand(Event event) { if (Ctrl(SDLK_MINUS)) { ReloadFont((int32_t)MainFont.size - 1); + run_window_command = false; } else if (Ctrl(SDLK_EQUALS)) { ReloadFont((int32_t)MainFont.size + 1); + run_window_command = false; } return run_window_command; diff --git a/src/text_editor/management.cpp b/src/text_editor/management.cpp index 1f487e1..0cdb471 100644 --- a/src/text_editor/management.cpp +++ b/src/text_editor/management.cpp @@ -102,7 +102,7 @@ WindowID GetLastActiveWindow() { return NullWindowID; } -void SetActiveWindow(WindowID window) { +bool SetActiveWindow(WindowID window) { if (window.id != ActiveWindow.id && LastFrameIDWhenSwitchedActiveWindow != FrameID) { LastFrameIDWhenSwitchedActiveWindow = FrameID; ActiveWindow = window; @@ -110,7 +110,9 @@ void SetActiveWindow(WindowID window) { if (!w->dont_save_in_active_window_history) { Add(&WindowSwitchHistory, window); } + return true; } + return false; } Window *FindParentWindow(ViewID view_id) { diff --git a/src/text_editor/text_editor.cpp b/src/text_editor/text_editor.cpp index 28986d9..49480f2 100644 --- a/src/text_editor/text_editor.cpp +++ b/src/text_editor/text_editor.cpp @@ -268,7 +268,6 @@ int main() SDL_DestroyWindow(window); SDL_Quit(); - EndProfileScope(); EndProfiler(); return 0;