1
0
mirror of synced 2024-11-24 07:40:17 +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) {
ImGui::SetNextWindowPos(ImHexApi::System::getMainWindowPosition() + (ImHexApi::System::getMainWindowSize() / 2.0F), ImGuiCond_Always, ImVec2(0.5F, 0.5F));
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;
}