Fix garbled text when display scalling > 300%

On Windows, if your display scaling is greater than 300%,
the text rendered by imgui will be garbled. Allowing imgui
to do the scaling instead of making the font to large
corrects the issue.
This commit is contained in:
Leland Lucius 2023-12-31 18:48:45 -06:00
parent 7ce38201c8
commit a77847c2ad
2 changed files with 3 additions and 1 deletions

View File

@ -6428,7 +6428,7 @@ void GLCanvas3D::_resize(unsigned int w, unsigned int h)
m_last_w = w;
m_last_h = h;
const float font_size = 1.5f * wxGetApp().em_unit();
const float font_size = 1.0f * wxGetApp().em_unit();
#if ENABLE_RETINA_GL
imgui->set_scaling(font_size, 1.0f, m_retina_helper->get_scale_factor());
#else

View File

@ -2110,6 +2110,7 @@ void ImGuiWrapper::init_font(bool compress)
throw Slic3r::RuntimeError("ImGui: Could not load deafult font");
}
}
default_font->Scale = 1.5f;
if (m_is_korean)
bold_font = io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/" + "NotoSansKR-Bold.ttf").c_str(), m_font_size, &cfg, ranges.Data);
@ -2119,6 +2120,7 @@ void ImGuiWrapper::init_font(bool compress)
bold_font = io.Fonts->AddFontDefault();
if (bold_font == nullptr) { throw Slic3r::RuntimeError("ImGui: Could not load deafult font"); }
}
bold_font->Scale = 1.5f;
#ifdef __APPLE__
ImFontConfig config;