2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-17 19:25:23 +00:00

Use freetype for ImGui fonts if available

This commit is contained in:
2021-06-07 11:28:30 -04:00
committed by Phillip Stephens
parent a9bcb7a9ce
commit 073af40c4d
7 changed files with 68 additions and 44 deletions

View File

@@ -29,7 +29,7 @@ void ImGuiStringViewText(std::string_view text) {
void ImGuiTextCenter(std::string_view text) {
ImGui::NewLine();
float fontSize = ImGui::GetFontSize() * float(text.size()) / 2;
float fontSize = ImGui::CalcTextSize(text.data(), text.data() + text.size()).x;
ImGui::SameLine(ImGui::GetWindowSize().x / 2 - fontSize + fontSize / 2);
ImGuiStringViewText(text);
}
@@ -1118,7 +1118,6 @@ void ImGuiConsole::ShowAppMainMenuBar(bool canInspect) {
}
}
s32 TranslateBooSpecialKey(boo::ESpecialKey key) { return 256 + static_cast<int>(key); }
void ImGuiConsole::PreUpdate() {
if (!m_isInitialized) {
m_isInitialized = true;