From a4176ef9338e7a1984fd983661351275c7ff19f1 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 24 Aug 2018 16:52:06 +0200 Subject: [PATCH] Bugfix - dialog that changes number of copies deleted the object when cancelled --- lib/Slic3r/GUI/Plater.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index dbdf0be27..cae167f28 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -995,9 +995,10 @@ sub set_number_of_copies { my $model_object = $self->{model}->objects->[$obj_idx]; # prompt user - my $copies = Wx::GetNumberFromUser("", L("Enter the number of copies of the selected object:"), L("Copies"), $model_object->instances_count, 0, 1000, $self); + my $copies = -1; + $copies = Wx::GetNumberFromUser("", L("Enter the number of copies of the selected object:"), L("Copies"), $model_object->instances_count, 0, 1000, $self); my $diff = $copies - $model_object->instances_count; - if ($diff == 0) { + if ($diff == 0 || $copies == -1) { # no variation $self->resume_background_process; } elsif ($diff > 0) {