Fix ImGui::Text() format strings (#41)

* Fix format string
This commit is contained in:
Marco Rubin 2022-08-25 12:15:02 +02:00 committed by GitHub
parent 62ef3ea493
commit 1d3f62a09c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -432,7 +432,7 @@ void LatteShaderCache_ShowProgress(const std::function <bool(void)>& loadUpdateF
}
ImGui::SetCursorPosX(width - ImGui::CalcTextSize(text.c_str()).x / 2);
ImGui::Text(text.c_str());
ImGui::Text("%s", text.c_str());
float percentLoaded;
if(isPipelines)
@ -446,7 +446,7 @@ void LatteShaderCache_ShowProgress(const std::function <bool(void)>& loadUpdateF
else
text = fmt::format("{}/{} ({}%%)", g_shaderCacheLoaderState.loadedShaderFiles, g_shaderCacheLoaderState.shaderFileCount, (int)(percentLoaded * 100));
ImGui::SetCursorPosX(width - ImGui::CalcTextSize(text.c_str()).x / 2);
ImGui::Text(text.c_str());
ImGui::Text("%s", text.c_str());
ImGui::End();
}
ImGui::PopFont();

View File

@ -531,6 +531,6 @@ void VKRMemoryManager::appendOverlayHeapDebugInfo()
uint32 heapSizeMB = (heapSize / 1024 / 1024);
uint32 allocatedBytesMB = (allocatedBytes / 1024 / 1024);
ImGui::Text(fmt::format("{0:#08x} Size: {1}MB/{2}MB", itr.first, allocatedBytesMB, heapSizeMB).c_str());
ImGui::Text("%s", fmt::format("{0:#08x} Size: {1}MB/{2}MB", itr.first, allocatedBytesMB, heapSizeMB).c_str());
}
}

View File

@ -390,7 +390,7 @@ void swkbd_render(bool mainWindow)
ImGui::PushFont(font);
if (ImGui::Begin("Keyboard Input", nullptr, kPopupFlags))
{
ImGui::Text(_utf8WrapperPtr(ICON_FA_KEYBOARD));
ImGui::Text("%s", _utf8WrapperPtr(ICON_FA_KEYBOARD));
ImGui::SameLine(70);
auto text = boost::nowide::narrow(fmt::format(L"{}", swkbdInternalState->formStringBuffer));