[fix] fix stream window rendering height

This commit is contained in:
dijunkun
2026-02-24 14:31:34 +08:00
parent 103b8372e4
commit 0e6cee0961
2 changed files with 8 additions and 3 deletions

View File

@@ -2051,7 +2051,8 @@ void Render::UpdateRenderRect() {
(int)(render_area_width * video_ratio_reverse)};
} else if (render_area_width > render_area_height * video_ratio) {
props->stream_render_rect_ = {
(int)abs(render_area_width - render_area_height * video_ratio) / 2,
(int)abs(render_area_width - render_area_height * video_ratio) / 2 +
(int)props->render_window_x_,
(int)props->render_window_y_, (int)(render_area_height * video_ratio),
(int)render_area_height};
} else {

View File

@@ -117,7 +117,9 @@ int Render::StreamWindow() {
ImGui::SetWindowFontScale(0.6f);
ImGui::SetNextWindowSize(
ImVec2(stream_window_width_, stream_window_height_),
ImVec2(stream_window_width_,
stream_window_height_ -
(fullscreen_button_pressed_ ? 0 : title_bar_height_)),
ImGuiCond_Always);
ImGui::SetNextWindowPos(
ImVec2(0, fullscreen_button_pressed_ ? 0 : title_bar_height_),
@@ -217,7 +219,9 @@ int Render::StreamWindow() {
if (props->tab_selected_) {
ImGui::SetNextWindowSize(
ImVec2(stream_window_width_, stream_window_height_),
ImVec2(stream_window_width_,
stream_window_height_ -
(fullscreen_button_pressed_ ? 0 : title_bar_height_)),
ImGuiCond_Always);
ImGui::SetNextWindowPos(ImVec2(0, 0), ImGuiCond_Always);
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));