mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
Set dpi scaling to solve display errot when using high dpi displayer
This commit is contained in:
@@ -241,6 +241,15 @@ int Render::Run() {
|
||||
|
||||
io.Fonts->Build();
|
||||
|
||||
SDL_GL_GetDrawableSize(main_window_, &main_window_width_real_,
|
||||
&main_window_height_real_);
|
||||
dpi_scaling_w_ = (float)main_window_width_real_ / (float)main_window_width_;
|
||||
dpi_scaling_h_ = (float)main_window_width_real_ / (float)main_window_width_;
|
||||
|
||||
LOG_INFO("Use dpi scaling [{}x{}]", dpi_scaling_w_, dpi_scaling_h_);
|
||||
|
||||
SDL_RenderSetScale(main_renderer_, dpi_scaling_w_, dpi_scaling_h_);
|
||||
|
||||
// Setup Dear ImGui style
|
||||
// ImGui::StyleColorsDark();
|
||||
ImGui::StyleColorsLight();
|
||||
|
||||
Reference in New Issue
Block a user