diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2020-02-13 11:50:06 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2020-02-13 11:50:06 +0300 |
commit | b0218daafe63eecc3e4dbd4d4074d503ab7d8d2d (patch) | |
tree | 3ff6929c6b5845f9ee1e6980741e83f4860e0eaa /src/slic3r/GUI/Gizmos | |
parent | 5797c9edc2999d36065c747b401558ba324abcc6 (diff) |
ENABLE_MODIFIED_TOOLBAR_TEXTURES set as default
Diffstat (limited to 'src/slic3r/GUI/Gizmos')
-rw-r--r-- | src/slic3r/GUI/Gizmos/GLGizmosManager.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index 79ac6a00d..7e334c29f 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -889,14 +889,9 @@ void GLGizmosManager::render_background(float left, float top, float right, floa void GLGizmosManager::do_render_overlay() const { -#if ENABLE_MODIFIED_TOOLBAR_TEXTURES std::vector<size_t> selectable_idxs = get_selectable_idxs(); if (selectable_idxs.empty()) return; -#else - if (m_gizmos.empty()) - return; -#endif // ENABLE_MODIFIED_TOOLBAR_TEXTURES float cnv_w = (float)m_parent.get_canvas_size().get_width(); float cnv_h = (float)m_parent.get_canvas_size().get_height(); @@ -928,7 +923,6 @@ void GLGizmosManager::do_render_overlay() const int tex_width = m_icons_texture.get_width(); int tex_height = m_icons_texture.get_height(); -#if ENABLE_MODIFIED_TOOLBAR_TEXTURES if ((icons_texture_id == 0) || (tex_width <= 1) || (tex_height <= 1)) return; @@ -938,39 +932,18 @@ void GLGizmosManager::do_render_overlay() const // tiles in the texture are spaced by 1 pixel float u_offset = 1.0f / (float)tex_width; float v_offset = 1.0f / (float)tex_height; -#else - if ((icons_texture_id == 0) || (tex_width <= 0) || (tex_height <= 0)) - return; - - float inv_tex_width = (tex_width != 0) ? 1.0f / tex_width : 0.0f; - float inv_tex_height = (tex_height != 0) ? 1.0f / tex_height : 0.0f; -#endif // ENABLE_MODIFIED_TOOLBAR_TEXTURES -#if ENABLE_MODIFIED_TOOLBAR_TEXTURES for (size_t idx : selectable_idxs) -#else - for (size_t idx : get_selectable_idxs()) -#endif // ENABLE_MODIFIED_TOOLBAR_TEXTURES { GLGizmoBase* gizmo = m_gizmos[idx].get(); unsigned int sprite_id = gizmo->get_sprite_id(); int icon_idx = (m_current == idx) ? 2 : ((m_hover == idx) ? 1 : (gizmo->is_activable()? 0 : 3)); -#if ENABLE_MODIFIED_TOOLBAR_TEXTURES float v_top = v_offset + sprite_id * dv; float u_left = u_offset + icon_idx * du; float v_bottom = v_top + dv - v_offset; float u_right = u_left + du - u_offset; -#else - float u_icon_size = icons_size * inv_tex_width; - float v_icon_size = icons_size * inv_tex_height; - - float v_top = sprite_id * v_icon_size; - float u_left = icon_idx * u_icon_size; - float v_bottom = v_top + v_icon_size; - float u_right = u_left + u_icon_size; -#endif // ENABLE_MODIFIED_TOOLBAR_TEXTURES GLTexture::render_sub_texture(icons_texture_id, zoomed_top_x, zoomed_top_x + zoomed_icons_size, zoomed_top_y - zoomed_icons_size, zoomed_top_y, { { u_left, v_bottom }, { u_right, v_bottom }, { u_right, v_top }, { u_left, v_top } }); if (idx == m_current) { |