diff --git a/lib/Slic3r/GUI/OptionsGroup/Field.pm b/lib/Slic3r/GUI/OptionsGroup/Field.pm index bd3092f7c..4d64a64ee 100644 --- a/lib/Slic3r/GUI/OptionsGroup/Field.pm +++ b/lib/Slic3r/GUI/OptionsGroup/Field.pm @@ -547,13 +547,17 @@ sub BUILD { $sizer->Add($textctrl, 0, wxALIGN_CENTER_VERTICAL, 0); EVT_SLIDER($self->parent, $slider, sub { - $self->_update_textctrl; - $self->_on_change($self->option->opt_id); + if (! $self->disable_change_event) { + $self->textctrl->SetLabel($self->get_value); + $self->_on_change($self->option->opt_id); + } }); EVT_TEXT($self->parent, $textctrl, sub { my $value = $textctrl->GetValue; if ($value =~ /^-?\d+(\.\d*)?$/) { - $self->set_value($value); + $self->disable_change_event(1); + $self->slider->SetValue($value*$self->scale); + $self->disable_change_event(0); $self->_on_change($self->option->opt_id); } }); @@ -567,7 +571,7 @@ sub set_value { $self->disable_change_event(1); $self->slider->SetValue($value*$self->scale); - $self->_update_textctrl; + $self->textctrl->SetLabel($self->get_value); $self->disable_change_event(0); } @@ -576,11 +580,6 @@ sub get_value { return $self->slider->GetValue/$self->scale; } -sub _update_textctrl { - my ($self) = @_; - $self->textctrl->SetLabel($self->get_value); -} - sub enable { my ($self) = @_;