Skip to content
This repository was archived by the owner on Jun 18, 2024. It is now read-only.

Commit 503c91a

Browse files
committed
fix fonts change crashing
1 parent eb54adf commit 503c91a

File tree

4 files changed

+2
-3
lines changed

4 files changed

+2
-3
lines changed

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"gd": {
44
"win": "2.204"
55
},
6-
"version": "v2.11.0",
6+
"version": "v2.11.1",
77
"id": "maxnu.gd_mega_overlay",
88
"name": "GD Mega Overlay",
99
"developers": ["maxnu", "SpaghettDev"],

src/GUI/GUI.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ void GUI::setFont(const ghc::filesystem::path& font)
440440
{
441441
ImFont* fnt = ImGui::GetIO().Fonts->AddFontFromFileTTF(string::wideToUtf8(font.wstring()).c_str(), fontScale * uiSizeFactor);
442442
ImGui::GetIO().FontDefault = fnt;
443+
ImGuiCocos::get().reloadFontTexture();
443444
}
444445

445446
void GUI::setStyle()

src/GUI/StyleEditor.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ void GUI::drawStyleEditor()
6868
if(ImGui::IsItemDeactivatedAfterEdit())
6969
{
7070
GUI::setFont(GUI::fontCombo.getSelectedFilePath());
71-
ImGuiCocos::get().reloadFontTexture();
7271
}
7372

7473
ImGui::Text("Borders");

src/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,6 @@ void initGUI()
445445
{
446446
GUI::loadStyle(GUI::styleCombo.getSelectedFilePath());
447447
GUI::setFont(GUI::fontCombo.getSelectedFilePath());
448-
ImGuiCocos::get().reloadFontTexture();
449448
}
450449

451450
if(GUI::fontCombo.draw())

0 commit comments

Comments
 (0)