gui: Only center the image if width and height is <= 960x544

This commit is contained in:
Joel16 2020-09-13 21:10:14 -04:00
parent 109f54ff04
commit c5cd90246e

View File

@ -50,7 +50,9 @@ namespace GUI {
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
if (ImGui::Begin(entry->d_name, nullptr, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar)) {
ImGui::SetCursorPos((ImGui::GetWindowSize() - ImVec2(texture->width, texture->height)) * 0.5f);
if ((texture->width <= 960) && (texture->height <= 544))
ImGui::SetCursorPos((ImGui::GetWindowSize() - ImVec2(texture->width, texture->height)) * 0.5f);
ImGui::Image(reinterpret_cast<ImTextureID>(texture->id), ImVec2(texture->width, texture->height));
}
@ -64,7 +66,10 @@ namespace GUI {
if (ImGui::Begin(entry->d_name, nullptr, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar)) {
frame_count++;
ImGui::SetCursorPos((ImGui::GetWindowSize() - ImVec2(textures[frame_count].width, textures[frame_count].height)) * 0.5f);
if ((texture->width <= 960) && (texture->height <= 544))
ImGui::SetCursorPos((ImGui::GetWindowSize() - ImVec2(texture->width, texture->height)) * 0.5f);
sceKernelDelayThread(textures[frame_count].delay * 10000);
ImGui::Image(reinterpret_cast<ImTextureID>(textures[frame_count].id), ImVec2(textures[frame_count].width, textures[frame_count].height));