From 5f6a8adf7cda863e07f9fbf441c9cd25cf935117 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 24 Aug 2018 12:06:05 +0200 Subject: [PATCH] Modified render order of gizmos --- xs/src/slic3r/GUI/GLCanvas3D.cpp | 4 +++- xs/src/slic3r/GUI/GLGizmo.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xs/src/slic3r/GUI/GLCanvas3D.cpp b/xs/src/slic3r/GUI/GLCanvas3D.cpp index 40362ac87..0bb1df25d 100644 --- a/xs/src/slic3r/GUI/GLCanvas3D.cpp +++ b/xs/src/slic3r/GUI/GLCanvas3D.cpp @@ -507,6 +507,7 @@ void GLCanvas3D::Bed::_render_prusa(float theta) const if (triangles_vcount > 0) { ::glEnable(GL_DEPTH_TEST); + ::glDepthMask(GL_FALSE); ::glEnable(GL_BLEND); ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -535,6 +536,7 @@ void GLCanvas3D::Bed::_render_prusa(float theta) const ::glDisable(GL_TEXTURE_2D); ::glDisable(GL_BLEND); + ::glDepthMask(GL_TRUE); } } @@ -2357,7 +2359,6 @@ void GLCanvas3D::render() // draw scene _render_background(); - _render_current_gizmo(); if (is_custom_bed) // untextured bed needs to be rendered before objects { @@ -2373,6 +2374,7 @@ void GLCanvas3D::render() _render_bed(theta); } + _render_current_gizmo(); _render_cutting_plane(); // draw overlays diff --git a/xs/src/slic3r/GUI/GLGizmo.cpp b/xs/src/slic3r/GUI/GLGizmo.cpp index 0ff5909a0..212bf51a9 100644 --- a/xs/src/slic3r/GUI/GLGizmo.cpp +++ b/xs/src/slic3r/GUI/GLGizmo.cpp @@ -837,7 +837,7 @@ void GLGizmoScale3D::on_render(const BoundingBoxf3& box) const { ::glEnable(GL_DEPTH_TEST); - Vec3d offset_vec((double)Offset, (double)Offset, (double)Offset); + Vec3d offset_vec = (double)Offset * Vec3d::Ones(); m_box = BoundingBoxf3(box.min - offset_vec, box.max + offset_vec); const Vec3d& center = m_box.center();