1
0
mirror of synced 2024-11-24 15:50:16 +01:00

fix: Popup positions when viewports are disabled

This commit is contained in:
WerWolv 2023-11-23 09:19:51 +01:00
parent af18501726
commit de4ea4081a

View File

@ -741,7 +741,11 @@ namespace hex {
const auto flags = currPopup->getFlags() | (!hasConstraints ? (ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize) : ImGuiWindowFlags_None);
if (!positionSet) {
if (ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
ImGui::SetNextWindowPos(ImHexApi::System::getMainWindowPosition() + (ImHexApi::System::getMainWindowSize() / 2.0F), ImGuiCond_Always, ImVec2(0.5F, 0.5F));
else
ImGui::SetNextWindowPos(ImHexApi::System::getMainWindowSize() / 2.0F, ImGuiCond_Always, ImVec2(0.5F, 0.5F));
if (sizeSet)
positionSet = true;
}