From 26de6a0ad9ed082e14de928ef03f4db379e9686f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 26 May 2016 17:27:02 +0200 Subject: spline-widget: step by few pixels and not a random constant amount --- spline-widget/qfunctionconfigurator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spline-widget') diff --git a/spline-widget/qfunctionconfigurator.cpp b/spline-widget/qfunctionconfigurator.cpp index 73d6d3c2..18af8c46 100644 --- a/spline-widget/qfunctionconfigurator.cpp +++ b/spline-widget/qfunctionconfigurator.cpp @@ -132,8 +132,9 @@ void QFunctionConfigurator::drawFunction() QPen pen(color, 1.2, Qt::SolidLine); + const double step_ = line_length_pixels / c.x(); + const double step = std::max(1e-2, step_); const double max = _config->maxInput(); - const double step = std::max(1e-2, max / 1000.); painter.save(); painter.setPen(pen); -- cgit v1.2.3