mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Beta implementation of FrameBuffer projection change for cropping.
This commit is contained in:
@@ -395,8 +395,13 @@ void ImGuiVisitor::visit (Source& s)
|
||||
|
||||
// preview
|
||||
float preview_width = ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN;
|
||||
ImVec2 imagesize ( preview_width, preview_width / s.frame()->aspectRatio());
|
||||
ImGui::Image((void*)(uintptr_t) s.frame()->texture(), imagesize);
|
||||
float width = preview_width;
|
||||
float height = width / ( s.frame()->aspectRatio() * s.frame()->projectionAspectRatio() );
|
||||
if (height > 200) {
|
||||
height = 200;
|
||||
width = height * ( s.frame()->aspectRatio() * s.frame()->projectionAspectRatio() );
|
||||
}
|
||||
ImGui::Image((void*)(uintptr_t) s.frame()->texture(), ImVec2(width, height));
|
||||
|
||||
ImVec2 pos = ImGui::GetCursorPos(); // remember where we were...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user