Fixed conflicts after merge with master

This commit is contained in:
Enrico Turri 2019-04-25 08:12:48 +02:00
commit b557336fa6
52 changed files with 2105 additions and 1250 deletions

View file

@ -703,6 +703,7 @@ void GLCanvas3D::WarningTexture::activate(WarningTexture::Warning warning, bool
m_warnings.erase(it);
if (m_warnings.empty()) { // nothing remains to be shown
reset();
m_msg_text = "";// save information for rescaling
return;
}
}
@ -723,6 +724,10 @@ void GLCanvas3D::WarningTexture::activate(WarningTexture::Warning warning, bool
}
_generate(text, canvas, red_colored); // GUI::GLTexture::reset() is called at the beginning of generate(...)
// save information for rescaling
m_msg_text = text;
m_is_colored_red = red_colored;
}
@ -791,7 +796,9 @@ bool GLCanvas3D::WarningTexture::_generate(const std::string& msg_utf8, const GL
wxMemoryDC memDC;
// select default font
const float scale = canvas.get_canvas_size().get_scale_factor();
wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Scale(scale);
// wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Scale(scale);
wxFont font = wxGetApp().normal_font();//! #ys_FIXME_experiment
font.MakeLarger();
font.MakeBold();
memDC.SetFont(font);
@ -892,6 +899,14 @@ void GLCanvas3D::WarningTexture::render(const GLCanvas3D& canvas) const
}
}
void GLCanvas3D::WarningTexture::rescale(const GLCanvas3D& canvas)
{
if (m_msg_text.empty())
return;
_generate(m_msg_text, canvas, m_is_colored_red);
}
const unsigned char GLCanvas3D::LegendTexture::Squares_Border_Color[3] = { 64, 64, 64 };
const unsigned char GLCanvas3D::LegendTexture::Default_Background_Color[3] = { (unsigned char)(DEFAULT_BG_LIGHT_COLOR[0] * 255.0f), (unsigned char)(DEFAULT_BG_LIGHT_COLOR[1] * 255.0f), (unsigned char)(DEFAULT_BG_LIGHT_COLOR[2] * 255.0f) };
const unsigned char GLCanvas3D::LegendTexture::Error_Background_Color[3] = { (unsigned char)(ERROR_BG_LIGHT_COLOR[0] * 255.0f), (unsigned char)(ERROR_BG_LIGHT_COLOR[1] * 255.0f), (unsigned char)(ERROR_BG_LIGHT_COLOR[2] * 255.0f) };
@ -962,7 +977,8 @@ bool GLCanvas3D::LegendTexture::generate(const GCodePreviewData& preview_data, c
const int scaled_border = Px_Border * scale;
// select default font
wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Scale(scale_gl);
// wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Scale(scale_gl);
wxFont font = wxGetApp().normal_font();//! #ys_FIXME_experiment
#ifdef __WXMSW__
// Disabling ClearType works, but the font returned is very different (much thicker) from the default.
// msw_disable_cleartype(font);
@ -3204,6 +3220,11 @@ void GLCanvas3D::set_cursor(ECursorType type)
}
}
void GLCanvas3D::msw_rescale()
{
m_warning_texture.rescale(*this);
}
bool GLCanvas3D::_is_shown_on_screen() const
{
return (m_canvas != nullptr) ? m_canvas->IsShownOnScreen() : false;
@ -3847,7 +3868,8 @@ void GLCanvas3D::_render_gizmos_overlay() const
#if ENABLE_RETINA_GL
m_gizmos.set_overlay_scale(m_retina_helper->get_scale_factor());
#else
m_gizmos.set_overlay_scale(m_canvas->GetContentScaleFactor());
// m_gizmos.set_overlay_scale(m_canvas->GetContentScaleFactor());
m_gizmos.set_overlay_scale(wxGetApp().em_unit()*0.1f);//! #ys_FIXME_experiment
#endif /* __WXMSW__ */
m_gizmos.render_overlay(*this, m_selection);
@ -3859,7 +3881,8 @@ void GLCanvas3D::_render_toolbar() const
#if ENABLE_RETINA_GL
m_toolbar.set_scale(m_retina_helper->get_scale_factor());
#else
m_toolbar.set_scale(m_canvas->GetContentScaleFactor());
// m_toolbar.set_scale(m_canvas->GetContentScaleFactor());
m_toolbar.set_scale(wxGetApp().em_unit()*0.1f);//! #ys_FIXME_experiment
#endif // ENABLE_RETINA_GL
Size cnv_size = get_canvas_size();
@ -3922,7 +3945,8 @@ void GLCanvas3D::_render_view_toolbar() const
#if ENABLE_RETINA_GL
m_view_toolbar.set_scale(m_retina_helper->get_scale_factor());
#else
m_view_toolbar.set_scale(m_canvas->GetContentScaleFactor());
// m_view_toolbar.set_scale(m_canvas->GetContentScaleFactor());
m_view_toolbar.set_scale(wxGetApp().em_unit()*0.1f); //! #ys_FIXME_experiment
#endif // ENABLE_RETINA_GL
Size cnv_size = get_canvas_size();