FIX:fixed crashed when starting Studio on secondary display

Change-Id: I0392607479a25b5e2b2704f5569d6b8b94ba7e3d
This commit is contained in:
Tao Wang 2022-09-05 15:52:23 +08:00 committed by Lane.Wei
parent 3fb942077c
commit 0ed1d2ed34
1 changed files with 13 additions and 5 deletions

View File

@ -5906,8 +5906,16 @@ void GLCanvas3D::_check_and_update_toolbar_icon_scale()
float noitems_width = top_tb_width - size * items_cnt; // width of separators and borders in top toolbars
// calculate scale needed for items in all top toolbars
#ifdef __WINDOWS__
cnv_size.set_width(cnv_size.get_width() + m_separator_toolbar.get_width() + collapse_toolbar_width);
#endif
float new_h_scale = (cnv_size.get_width() - noitems_width) / (items_cnt * GLToolbar::Default_Icons_Size);
//for protect
if (new_h_scale <= 0) {
new_h_scale = 1;
}
//use the same value as horizon
float new_v_scale = new_h_scale;
#else