From f1f1b515cd3bbf7b5631d6ed5d4b1c1549a08704 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 30 Aug 2019 14:10:59 +0200 Subject: [PATCH] Fixed update of both canvas when compressed bed textures have been completely sent to gpu --- src/slic3r/GUI/3DBed.cpp | 6 +++--- src/slic3r/GUI/GLCanvas3D.hpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 5b7473980..4185b6664 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -474,10 +474,10 @@ void Bed3D::render_texture(const std::string& filename, bool bottom, GLCanvas3D& m_requires_canvas_update = true; } else if (m_requires_canvas_update && m_texture.all_compressed_data_sent_to_gpu()) - { - canvas.stop_keeping_dirty(); m_requires_canvas_update = false; - } + + if (m_texture.all_compressed_data_sent_to_gpu() && canvas.is_keeping_dirty()) + canvas.stop_keeping_dirty(); if (m_triangles.get_vertices_count() > 0) { diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 753e8af82..0beef094b 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -637,6 +637,7 @@ public: void set_cursor(ECursorType type); void msw_rescale(); + bool is_keeping_dirty() const { return m_keep_dirty; } void start_keeping_dirty() { m_keep_dirty = true; } void stop_keeping_dirty() { m_keep_dirty = false; }