From 9624222c3e5b216d7d48b78a3ac17292a16e2d06 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Thu, 15 Jun 2023 12:12:30 +0200 Subject: [PATCH] Fix for font preview offsets on scaled displayes: https://github.com/prusa3d/PrusaSlicer/issues/10511 --- src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp | 4 +++- src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp index 0d0751b45b..4ca28d2eaa 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp @@ -941,6 +941,8 @@ GLGizmoEmboss::GuiCfg GLGizmoEmboss::create_gui_configuration() int max_style_image_height = 1.5 * input_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.x() = cfg.input_width; + cfg.face_name_texture_offset_x = cfg.input_width + space; return cfg; } @@ -1979,7 +1981,7 @@ void GLGizmoEmboss::draw_font_list() } 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) init_font_name_texture(); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp index 318917863e..2b09040743 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp @@ -193,8 +193,7 @@ private: // maximal size of face name image Vec2i face_name_size = Vec2i(100, 0); - float face_name_max_width = 100.f; - float face_name_texture_offset_x = 105.f; + float face_name_texture_offset_x = 0.f; // maximal texture generate jobs running at once unsigned int max_count_opened_font_files = 10;