Fix scissor test when screen scaling is on

Use full screen for gui settings
This commit is contained in:
Flyinghead 2019-02-20 23:22:58 +01:00
parent 0f1630a1b7
commit 26e43ed9bd
3 changed files with 6 additions and 8 deletions

View File

@ -857,7 +857,7 @@ static bool RenderFrame()
// Add x offset for aspect ratio > 4/3
min_x = min_x * dc2s_scale_h + ds2s_offs_x;
// Invert y coordinates when rendering to screen
min_y = screen_height - (min_y + height) * dc2s_scale_h;
min_y = screen_height * screen_scaling - (min_y + height) * dc2s_scale_h;
width *= dc2s_scale_h;
height *= dc2s_scale_h;

View File

@ -1896,7 +1896,7 @@ bool RenderFrame()
// Add x offset for aspect ratio > 4/3
min_x = min_x * dc2s_scale_h + ds2s_offs_x;
// Invert y coordinates when rendering to screen
min_y = screen_height - (min_y + height) * dc2s_scale_h;
min_y = screen_height * screen_scaling - (min_y + height) * dc2s_scale_h;
width *= dc2s_scale_h;
height *= dc2s_scale_h;

View File

@ -540,12 +540,9 @@ static void gui_display_settings()
if (!settings_opening)
ImGui_ImplOpenGL3_DrawBackground();
ImGui::SetNextWindowPos(ImVec2(screen_width / 2.f, screen_height / 2.f), ImGuiCond_Always, ImVec2(0.5f, 0.5f));
if (scaling < 1.5f)
ImGui::SetNextWindowSize(ImVec2(screen_height / 480.f * 640.f * 90.f / 100.f, screen_height * 90.f / 100.f));
else
// Use the entire screen width
ImGui::SetNextWindowSize(ImVec2(screen_width * 90.f / 100.f, screen_height * 90.f / 100.f));
ImGui::SetNextWindowPos(ImVec2(0, 0));
ImGui::SetNextWindowSize(ImVec2(screen_width, screen_height));
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0);
ImGui::Begin("Settings", NULL, /*ImGuiWindowFlags_AlwaysAutoResize |*/ ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse);
ImVec2 normal_padding = ImGui::GetStyle().FramePadding;
@ -887,6 +884,7 @@ static void gui_display_settings()
}
ImGui::PopStyleVar();
ImGui::End();
ImGui::PopStyleVar();
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData(), false);