From c370bb7141360776f603c9eec679e8d276dda56b Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Thu, 5 Dec 2019 12:22:24 +0100 Subject: [PATCH] Forces even size and disable compression for toolbar icon texture to try to solve artifacts on OsX Catalina --- src/slic3r/GUI/GLToolbar.cpp | 7 ++++++- src/slic3r/GUI/Gizmos/GLGizmosManager.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GLToolbar.cpp b/src/slic3r/GUI/GLToolbar.cpp index bd87778c9..b955f39b4 100644 --- a/src/slic3r/GUI/GLToolbar.cpp +++ b/src/slic3r/GUI/GLToolbar.cpp @@ -1194,7 +1194,12 @@ bool GLToolbar::generate_icons_texture() const states.push_back(std::make_pair(1, true)); } - bool res = m_icons_texture.load_from_svg_files_as_sprites_array(filenames, states, (unsigned int)(m_layout.icons_size * m_layout.scale), true); + unsigned int sprite_size_px = (unsigned int)(m_layout.icons_size * m_layout.scale); + // force even size + if (sprite_size_px % 2 != 0) + sprite_size_px += 1; + + bool res = m_icons_texture.load_from_svg_files_as_sprites_array(filenames, states, sprite_size_px, false); if (res) m_icons_texture_dirty = false; diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index 25dab0336..8ea2f176a 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -955,7 +955,12 @@ bool GLGizmosManager::generate_icons_texture() const states.push_back(std::make_pair(0, false)); states.push_back(std::make_pair(0, true)); - bool res = m_icons_texture.load_from_svg_files_as_sprites_array(filenames, states, (unsigned int)(m_overlay_icons_size * m_overlay_scale), true); + unsigned int sprite_size_px = (unsigned int)(m_overlay_icons_size * m_overlay_scale); + // force even size + if (sprite_size_px % 2 != 0) + sprite_size_px += 1; + + bool res = m_icons_texture.load_from_svg_files_as_sprites_array(filenames, states, sprite_size_px, false); if (res) m_icons_texture_dirty = false;