mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 20:35:56 +08:00
Fix for font preview offsets on scaled displayes:
https://github.com/prusa3d/PrusaSlicer/issues/10511
This commit is contained in:
parent
a0f5fe0fb7
commit
9624222c3e
@ -941,6 +941,8 @@ GLGizmoEmboss::GuiCfg GLGizmoEmboss::create_gui_configuration()
|
|||||||
int max_style_image_height = 1.5 * input_height;
|
int max_style_image_height = 1.5 * input_height;
|
||||||
cfg.max_style_image_size = Vec2i(max_style_image_width, max_style_image_height);
|
cfg.max_style_image_size = Vec2i(max_style_image_width, max_style_image_height);
|
||||||
cfg.face_name_size.y() = line_height_with_spacing;
|
cfg.face_name_size.y() = line_height_with_spacing;
|
||||||
|
cfg.face_name_size.x() = cfg.input_width;
|
||||||
|
cfg.face_name_texture_offset_x = cfg.input_width + space;
|
||||||
return cfg;
|
return cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1979,7 +1981,7 @@ void GLGizmoEmboss::draw_font_list()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!m_face_names.has_truncated_names)
|
if (!m_face_names.has_truncated_names)
|
||||||
init_truncated_names(m_face_names, m_gui_cfg->face_name_max_width);
|
init_truncated_names(m_face_names, m_gui_cfg->input_width);
|
||||||
|
|
||||||
if (m_face_names.texture_id == 0)
|
if (m_face_names.texture_id == 0)
|
||||||
init_font_name_texture();
|
init_font_name_texture();
|
||||||
|
@ -193,8 +193,7 @@ private:
|
|||||||
|
|
||||||
// maximal size of face name image
|
// maximal size of face name image
|
||||||
Vec2i face_name_size = Vec2i(100, 0);
|
Vec2i face_name_size = Vec2i(100, 0);
|
||||||
float face_name_max_width = 100.f;
|
float face_name_texture_offset_x = 0.f;
|
||||||
float face_name_texture_offset_x = 105.f;
|
|
||||||
|
|
||||||
// maximal texture generate jobs running at once
|
// maximal texture generate jobs running at once
|
||||||
unsigned int max_count_opened_font_files = 10;
|
unsigned int max_count_opened_font_files = 10;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user