Skip to content

Commit 05501d7

Browse files
committed
make output window center its content
1 parent 99de929 commit 05501d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/gui/gui.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,12 +1169,14 @@ void PCSX::GUI::endFrame() {
11691169
// if output is the only visible window in dockspace, switch to full window render mode automatically
11701170
outputWindowShown = false;
11711171
}
1172-
ImVec2 textureSize = ImGui::GetContentRegionAvail();
1172+
ImVec2 contentRegion = ImGui::GetContentRegionAvail();
1173+
ImVec2 textureSize = contentRegion;
11731174
if ((m_outputWindowSize.x != textureSize.x) || (m_outputWindowSize.y != textureSize.y)) {
11741175
m_outputWindowSize = textureSize;
11751176
m_setupScreenSize = true;
11761177
}
11771178
ImGuiHelpers::normalizeDimensions(textureSize, renderRatio);
1179+
ImGui::SetCursorPos(ImGui::GetCursorPos() + (contentRegion - textureSize) * 0.5f);
11781180
ImTextureID texture = m_offscreenTextures[m_currentTexture];
11791181
if (g_system->getArgs().isShadersDisabled()) {
11801182
ImGui::Image(texture, textureSize, ImVec2(0, 0), ImVec2(1, 1));

0 commit comments

Comments
 (0)