Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2017-04-05 16:55:02 +0300
committerbubnikv <bubnikv@gmail.com>2017-04-05 16:55:02 +0300
commitc40de7e4240c448fa83bf76bcf4ed89700692c1c (patch)
tree0a34580fb41a3724a1ae56b2543fef90e118aab6
parent7ffb3590c4bb3b3a5bf2b113232a1abc425744df (diff)
Fix of https://github.com/prusa3d/Slic3r/issues/218version_1.34.1
Cut function bug in accepting a numerical value
-rw-r--r--lib/Slic3r/GUI/OptionsGroup/Field.pm17
1 files changed, 8 insertions, 9 deletions
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) = @_;