From ea0e9a5873aecdc9799d39bc276e034b38126ff1 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 8 Jun 2020 13:17:07 +0200 Subject: [PATCH] Follow-up of 70478f226f739f08dba2fac59e44b0ddd9e009e5 -> Fixed printbed for regular gcode preview --- src/slic3r/GUI/GCodeViewer.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 281ccfa67..61d432b9a 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -253,16 +253,18 @@ void GCodeViewer::load(const GCodeProcessor::Result& gcode_result, const Print& load_shells(print, initialized); #if ENABLE_GCODE_VIEWER_AS_STATE - // adjust printbed size - const double margin = 10.0; - Vec2d min(m_bounding_box.min(0) - margin, m_bounding_box.min(1) - margin); - Vec2d max(m_bounding_box.max(0) + margin, m_bounding_box.max(1) + margin); - Pointfs bed_shape = { - { min(0), min(1) }, - { max(0), min(1) }, - { max(0), max(1) }, - { min(0), max(1) } }; - wxGetApp().plater()->set_bed_shape(bed_shape, "", ""); + if (wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer) { + // adjust printbed size + const double margin = 10.0; + Vec2d min(m_bounding_box.min(0) - margin, m_bounding_box.min(1) - margin); + Vec2d max(m_bounding_box.max(0) + margin, m_bounding_box.max(1) + margin); + Pointfs bed_shape = { + { min(0), min(1) }, + { max(0), min(1) }, + { max(0), max(1) }, + { min(0), max(1) } }; + wxGetApp().plater()->set_bed_shape(bed_shape, "", ""); + } #endif // ENABLE_GCODE_VIEWER_AS_STATE }