Fixed crash when slicing from Layers tab

This commit is contained in:
Enrico Turri 2018-06-26 12:50:04 +02:00
parent 87c1654e31
commit bd1d70d8d3
3 changed files with 2 additions and 2 deletions

View File

@ -233,7 +233,6 @@ sub mouse_event {
} elsif ($event->LeftUp) { } elsif ($event->LeftUp) {
if ($self->{drag_object}) { if ($self->{drag_object}) {
$self->{on_instances_moved}->(); $self->{on_instances_moved}->();
Slic3r::GUI::_3DScene::reset_current_canvas();
} }
$self->{drag_start_pos} = undef; $self->{drag_start_pos} = undef;
$self->{drag_object} = undef; $self->{drag_object} = undef;

View File

@ -279,6 +279,7 @@ sub reload_print {
my ($self, $force) = @_; my ($self, $force) = @_;
Slic3r::GUI::_3DScene::reset_volumes($self->canvas); Slic3r::GUI::_3DScene::reset_volumes($self->canvas);
Slic3r::GUI::_3DScene::reset_current_canvas();
$self->_loaded(0); $self->_loaded(0);
if (! $self->IsShown && ! $force) { if (! $self->IsShown && ! $force) {

View File

@ -2376,7 +2376,7 @@ void GLCanvas3D::load_gcode_preview(const GCodePreviewData& preview_data, const
if ((m_canvas != nullptr) && (m_print != nullptr)) if ((m_canvas != nullptr) && (m_print != nullptr))
{ {
// ensures that this canvas is current // ensures that this canvas is current
if (!_3DScene::set_current(m_canvas, false)) if (!_3DScene::set_current(m_canvas, true))
return; return;
if (m_volumes.empty()) if (m_volumes.empty())