imgui: Refactor font size, font initialization

This commit is contained in:
Vojtech Kral 2019-04-01 14:12:05 +02:00
parent 32a49d1468
commit 88cc93cdc9
4 changed files with 48 additions and 41 deletions

View file

@ -4403,11 +4403,13 @@ void GLCanvas3D::_resize(unsigned int w, unsigned int h)
if ((m_canvas == nullptr) && (m_context == nullptr))
return;
wxGetApp().imgui()->set_display_size((float)w, (float)h);
auto *imgui = wxGetApp().imgui();
imgui->set_display_size((float)w, (float)h);
imgui->set_font_size(m_canvas->GetFont().GetPixelSize().y);
#if ENABLE_RETINA_GL
wxGetApp().imgui()->set_style_scaling(m_retina_helper->get_scale_factor());
imgui->set_style_scaling(m_retina_helper->get_scale_factor());
#else
wxGetApp().imgui()->set_style_scaling(m_canvas->GetContentScaleFactor());
imgui->set_style_scaling(m_canvas->GetContentScaleFactor());
#endif
// ensures that this canvas is current