mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-03-28 12:27:21 +08:00
[fix] fix stream window size recalculation
This commit is contained in:
@@ -811,10 +811,10 @@ int Render::CreateMainWindow() {
|
|||||||
if (std::abs(dpi_scale_ - dpi_scale) > 0.01f) {
|
if (std::abs(dpi_scale_ - dpi_scale) > 0.01f) {
|
||||||
dpi_scale_ = dpi_scale;
|
dpi_scale_ = dpi_scale;
|
||||||
|
|
||||||
main_window_width_ = (int)(main_window_width_ * dpi_scale_);
|
main_window_width_ = (int)(main_window_width_default_ * dpi_scale_);
|
||||||
main_window_height_ = (int)(main_window_height_ * dpi_scale_);
|
main_window_height_ = (int)(main_window_height_default_ * dpi_scale_);
|
||||||
stream_window_width_ = (int)(stream_window_width_ * dpi_scale_);
|
stream_window_width_ = (int)(stream_window_width_default_ * dpi_scale_);
|
||||||
stream_window_height_ = (int)(stream_window_height_ * dpi_scale_);
|
stream_window_height_ = (int)(stream_window_height_default_ * dpi_scale_);
|
||||||
|
|
||||||
SDL_SetWindowSize(main_window_, (int)main_window_width_,
|
SDL_SetWindowSize(main_window_, (int)main_window_width_,
|
||||||
(int)main_window_height_);
|
(int)main_window_height_);
|
||||||
@@ -869,6 +869,9 @@ int Render::CreateStreamWindow() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stream_window_width_ = (int)(stream_window_width_default_ * dpi_scale_);
|
||||||
|
stream_window_height_ = (int)(stream_window_height_default_ * dpi_scale_);
|
||||||
|
|
||||||
stream_ctx_ = ImGui::CreateContext();
|
stream_ctx_ = ImGui::CreateContext();
|
||||||
if (!stream_ctx_) {
|
if (!stream_ctx_) {
|
||||||
LOG_ERROR("Stream context is null");
|
LOG_ERROR("Stream context is null");
|
||||||
|
|||||||
Reference in New Issue
Block a user