From 4a88075334de19b6861086bbfaae32a6130245ae Mon Sep 17 00:00:00 2001 From: bubnikv Date: Fri, 27 Jul 2018 22:31:24 +0200 Subject: Updated change log for the Prusa3D config index, bumped up the version to 1.41.0-alpha3 --- xs/src/libslic3r/libslic3r.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xs/src') diff --git a/xs/src/libslic3r/libslic3r.h b/xs/src/libslic3r/libslic3r.h index 77006cebe..2f07ca51a 100644 --- a/xs/src/libslic3r/libslic3r.h +++ b/xs/src/libslic3r/libslic3r.h @@ -14,7 +14,7 @@ #include #define SLIC3R_FORK_NAME "Slic3r Prusa Edition" -#define SLIC3R_VERSION "1.41.0-alpha2" +#define SLIC3R_VERSION "1.41.0-alpha3" #define SLIC3R_BUILD "UNKNOWN" typedef int32_t coord_t; -- cgit v1.2.3 From bf4871d7f8b5090ec9ce47a9ba168c6d7c09b8ee Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 30 Jul 2018 09:09:14 +0200 Subject: Improved remove hovering on objects when mouse leaves 3D scene --- xs/src/slic3r/GUI/GLCanvas3D.cpp | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'xs/src') diff --git a/xs/src/slic3r/GUI/GLCanvas3D.cpp b/xs/src/slic3r/GUI/GLCanvas3D.cpp index 6396233e8..46bcf4f44 100644 --- a/xs/src/slic3r/GUI/GLCanvas3D.cpp +++ b/xs/src/slic3r/GUI/GLCanvas3D.cpp @@ -2697,9 +2697,9 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) } else if (evt.Leaving()) { - // to remove hover when mouse goes out of this canvas - m_mouse.position = Pointf((coordf_t)pos.x, (coordf_t)pos.y); - render(); + // to remove hover on objects when the mouse goes out of this canvas + m_mouse.position = Pointf(-1.0, -1.0); + m_dirty = true; } else if (evt.LeftDClick() && (m_hover_volume_id != -1)) m_on_double_click_callback.call(); @@ -3403,20 +3403,22 @@ void GLCanvas3D::_picking_pass() const if (m_multisample_allowed) ::glEnable(GL_MULTISAMPLE); - const Size& cnv_size = get_canvas_size(); - - GLubyte color[4]; - ::glReadPixels(pos.x, cnv_size.get_height() - pos.y - 1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, (void*)color); - int volume_id = color[0] + color[1] * 256 + color[2] * 256 * 256; - - m_hover_volume_id = -1; - + int volume_id = -1; for (GLVolume* vol : m_volumes.volumes) { vol->hover = false; } - if (volume_id < (int)m_volumes.volumes.size()) + GLubyte color[4] = { 0, 0, 0, 0 }; + const Size& cnv_size = get_canvas_size(); + bool inside = (0 <= pos.x) && (pos.x < cnv_size.get_width()) && (0 <= pos.y) && (pos.y < cnv_size.get_height()); + if (inside) + { + ::glReadPixels(pos.x, cnv_size.get_height() - pos.y - 1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, (void*)color); + volume_id = color[0] + color[1] * 256 + color[2] * 256 * 256; + } + + if ((0 <= volume_id) && (volume_id < (int)m_volumes.volumes.size())) { m_hover_volume_id = volume_id; m_volumes.volumes[volume_id]->hover = true; @@ -3432,7 +3434,10 @@ void GLCanvas3D::_picking_pass() const m_gizmos.set_hover_id(-1); } else - m_gizmos.set_hover_id(254 - (int)color[2]); + { + m_hover_volume_id = -1; + m_gizmos.set_hover_id(inside ? (254 - (int)color[2]) : -1); + } // updates gizmos overlay if (_get_first_selected_object_id() != -1) -- cgit v1.2.3