diff --git a/GlosSITarget/Overlay.cpp b/GlosSITarget/Overlay.cpp index 9409cde..b2d85db 100644 --- a/GlosSITarget/Overlay.cpp +++ b/GlosSITarget/Overlay.cpp @@ -190,7 +190,7 @@ void Overlay::update() ImGui::Text("Version: %s", version::VERSION_STR); if (Settings::settings_path_ != "") { ImGui::SameLine(); - if (ImGui::Button("Save shortcut settings", {256, 32})) { + if (ImGui::Button("Save shortcut settings", {256 * ImGui::GetIO().FontGlobalScale, 32 * ImGui::GetIO().FontGlobalScale})) { Settings::StoreSettings(); } } @@ -320,8 +320,8 @@ bool Overlay::closeOverlayButton() const ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.0f, 0.f, 0.f, 0.0f)); ImGui::Begin("##CloseOverlayButton", nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize); ImGui::SetWindowPos({(window_.getSize().x - ImGui::GetWindowWidth()) / 2, 32}); - ImGui::SetWindowSize({256, 32}); - if (ImGui::Button("Return to Game", {256, 32})) { + ImGui::SetWindowSize({256 * ImGui::GetIO().FontGlobalScale, 32 * ImGui::GetIO().FontGlobalScale}); + if (ImGui::Button("Return to Game", {256 * ImGui::GetIO().FontGlobalScale, 32 * ImGui::GetIO().FontGlobalScale})) { trigger_state_change_(); ImGui::End(); ImGui::PopStyleColor(); @@ -341,9 +341,9 @@ bool Overlay::closeButton() const ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.6f, 0.f, 0.f, 0.9f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(1.f, 0.16f, 0.16f, 1.00f)); ImGui::Begin("##CloseButton", nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize); - ImGui::SetWindowSize({56 + 32, 32 + 32}); + ImGui::SetWindowSize({(56 + 32) * ImGui::GetIO().FontGlobalScale, (32 + 32) * ImGui::GetIO().FontGlobalScale}); ImGui::SetWindowPos({window_.getSize().x - ImGui::GetWindowWidth() + 32, -32}); - if (ImGui::Button("X##Close", {56, 32})) { + if (ImGui::Button("X##Close", {56 * ImGui::GetIO().FontGlobalScale, 32 * ImGui::GetIO().FontGlobalScale})) { ImGui::End(); ImGui::PopStyleColor(); ImGui::PopStyleColor(); diff --git a/GlosSITarget/TargetWindow.cpp b/GlosSITarget/TargetWindow.cpp index eae07e1..c795e89 100644 --- a/GlosSITarget/TargetWindow.cpp +++ b/GlosSITarget/TargetWindow.cpp @@ -81,8 +81,6 @@ TargetWindow::TargetWindow( float scale_copy = Settings::window.scale; ImGui::DragFloat("##UISCale", &scale_copy, 0.1f, 0.0f, 6.f); ImGui::Text("Values smaller than 0.3 reset to 1"); - - if (scale_copy > Settings::window.scale + 0.01f || scale_copy < Settings::window.scale - 0.01f) { Settings::window.scale = scale_copy; if (Settings::window.scale < 0.3f) {