From 092b1724bab1221cd1199eabffe0e01d97d2fe9b Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 23 Dec 2014 11:23:12 +0100 Subject: [PATCH] Fixed t/vibrationlimit.t --- t/vibrationlimit.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/t/vibrationlimit.t b/t/vibrationlimit.t index 882769c02..7bfa27acb 100644 --- a/t/vibrationlimit.t +++ b/t/vibrationlimit.t @@ -15,7 +15,7 @@ my $config = Slic3r::Config->new_from_defaults; # tolerance, in minutes # (our time estimation differs from the internal one because of decimals truncation) -my $epsilon = 0.003; +my $epsilon = 0.002; my $test = sub { my ($conf) = @_; @@ -57,8 +57,11 @@ my $test = sub { my $one_axis_would_trigger_limit_without_pause = 0; foreach my $axis (qw(X Y)) { + # get the direction by comparing the new $axis coordinate with the current one + # 1 = positive, 0 = no change, -1 = negative + my $dir = $info->{"new_$axis"} <=> $self->$axis; + # are we changing direction on this axis? - my $dir = $info->{"dist_$axis"} <=> ($args->{$axis} // $self->$axis); if ($dir != 0 && $dir{$axis} != $dir) { # this move changes direction on this axis if ($dir{$axis} != 0) {