From 412ae2865d9eaecf8134c96914c7eb04df4067db Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 21 Jan 2019 14:41:59 +0100 Subject: [PATCH] Fixed rendering of layer editing texture --- src/slic3r/GUI/GLCanvas3D.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index cec47c664..669418c0a 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1046,10 +1046,6 @@ void GLCanvas3D::LayersEditing::_render_active_object_annotations(const GLCanvas ::glPixelStorei(GL_UNPACK_ALIGNMENT, 1); ::glBindTexture(GL_TEXTURE_2D, m_z_texture_id); - ::glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); - ::glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, half_w, half_h, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); - ::glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, m_layers_texture.data.data()); - ::glTexSubImage2D(GL_TEXTURE_2D, 1, 0, 0, half_w, half_h, GL_RGBA, GL_UNSIGNED_BYTE, m_layers_texture.data.data() + m_layers_texture.width * m_layers_texture.height * 4); // Render the color bar float l = bar_rect.get_left(); @@ -1058,6 +1054,7 @@ void GLCanvas3D::LayersEditing::_render_active_object_annotations(const GLCanvas float b = bar_rect.get_bottom(); ::glBegin(GL_QUADS); + ::glNormal3f(0.0f, 0.0f, 1.0f); ::glVertex3f(l, b, 0.0f); ::glVertex3f(r, b, 0.0f); ::glVertex3f(r, t, m_object_max_z);