This commit is contained in:
bubnikv 2019-05-20 16:26:13 +02:00
commit c24e96f6e2
3 changed files with 10 additions and 6 deletions

View File

@ -4025,8 +4025,7 @@ void GLCanvas3D::_render_selection() const
#if ENABLE_RENDER_SELECTION_CENTER
void GLCanvas3D::_render_selection_center() const
{
if (!m_gizmos.is_running())
m_selection.render_center();
m_selection.render_center(m_gizmos.is_dragging());
}
#endif // ENABLE_RENDER_SELECTION_CENTER

View File

@ -955,14 +955,14 @@ void Selection::render(float scale_factor) const
}
#if ENABLE_RENDER_SELECTION_CENTER
void Selection::render_center() const
void Selection::render_center(bool gizmo_is_dragging) const
{
if (!m_valid || is_empty() || (m_quadric == nullptr))
return;
const Vec3d& center = get_bounding_box().center();
Vec3d center = gizmo_is_dragging ? m_cache.dragging_center : get_bounding_box().center();
glsafe(::glDisable(GL_DEPTH_TEST)));
glsafe(::glDisable(GL_DEPTH_TEST));
glsafe(::glEnable(GL_LIGHTING));

View File

@ -5,6 +5,11 @@
#include "libslic3r/Geometry.hpp"
#include "3DScene.hpp"
#if ENABLE_RENDER_SELECTION_CENTER
class GLUquadric;
typedef class GLUquadric GLUquadricObj;
#endif // ENABLE_RENDER_SELECTION_CENTER
namespace Slic3r {
namespace GUI {
@ -291,7 +296,7 @@ public:
void render(float scale_factor = 1.0) const;
#if ENABLE_RENDER_SELECTION_CENTER
void render_center() const;
void render_center(bool gizmo_is_dragging) const;
#endif // ENABLE_RENDER_SELECTION_CENTER
void render_sidebar_hints(const std::string& sidebar_field) const;