From 829bd3b164b90a68b0d73eac4a1bfa78aa520ba0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 22 Oct 2017 10:04:04 +0200 Subject: gui: must close module dialogs Otherwise settings don't get cancelled --- spline/spline.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'spline/spline.cpp') diff --git a/spline/spline.cpp b/spline/spline.cpp index 1252d3ae..2e29997a 100644 --- a/spline/spline.cpp +++ b/spline/spline.cpp @@ -378,13 +378,31 @@ void spline::set_bundle(bundle b, const QString& axis_name, Axis axis) double spline::max_input() const { QMutexLocker l(&_mutex); - return s ? s->opts.clamp_x_.to() : 0; + if (s) + { + using m = axis_opts::max_clamp; + const value& clamp = s->opts.clamp_x_; + const QList points = s->points; + if (clamp == m::x1000 && points.size()) + return points[points.size() - 1].x(); + return s ? std::fabs(clamp.to()) : 0; + } + return 0; } double spline::max_output() const { QMutexLocker l(&_mutex); - return s ? std::fabs(s->opts.clamp_y_.to()) : 0; + if (s) + { + using m = axis_opts::max_clamp; + const value& clamp = s->opts.clamp_y_; + const QList points = s->points; + if (clamp == m::x1000 && points.size()) + return points[points.size() - 1].y(); + return s ? std::fabs(clamp.to()) : 0; + } + return 0; } void spline::ensure_valid(QList& the_points) -- cgit v1.2.3