From 0615f38a2693f99003b2f286ed8c1a5185888c39 Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Sun, 17 Apr 2022 00:19:34 +0200 Subject: [PATCH] BugFix Thumbnail in 21:9 aspect ratio --- UserInterfaceManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index ba74bb2..f53f124 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -7330,7 +7330,7 @@ void Thumbnail::fill(const FrameBufferImage *image) if (!texture_) { glGenTextures(1, &texture_); glBindTexture( GL_TEXTURE_2D, texture_); - glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGB8, SESSION_THUMBNAIL_HEIGHT * 2, SESSION_THUMBNAIL_HEIGHT); + glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGB8, SESSION_THUMBNAIL_HEIGHT * 3, SESSION_THUMBNAIL_HEIGHT); } aspect_ratio_ = static_cast(image->width) / static_cast(image->height); @@ -7343,7 +7343,7 @@ void Thumbnail::fill(const FrameBufferImage *image) void Thumbnail::Render(float width) { if (filled()) - ImGui::Image((void*)(intptr_t)texture_, ImVec2(width, width/aspect_ratio_), ImVec2(0,0), ImVec2(0.5f*aspect_ratio_, 1.f)); + ImGui::Image((void*)(intptr_t)texture_, ImVec2(width, width/aspect_ratio_), ImVec2(0,0), ImVec2(0.333f*aspect_ratio_, 1.f)); } ///