summaryrefslogtreecommitdiffhomepage
path: root/spline/spline-widget.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-06-15 10:19:20 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-06-18 18:48:42 +0200
commit7d84db6caa0f56f785b9abf7920ca4c58c70a2fd (patch)
treec3ad00971f3a9f9bc2f7057c0ac1f93ea203d4ba /spline/spline-widget.cpp
parentd405b91787ecb332d4ecb8740c06ca84f7e8a6b3 (diff)
spline: speed up Qt spline ops
Diffstat (limited to 'spline/spline-widget.cpp')
-rw-r--r--spline/spline-widget.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/spline/spline-widget.cpp b/spline/spline-widget.cpp
index 0378da09..0b3e8da2 100644
--- a/spline/spline-widget.cpp
+++ b/spline/spline-widget.cpp
@@ -204,7 +204,7 @@ void spline_widget::drawFunction()
//#define DEBUG_SPLINE
#ifndef DEBUG_SPLINE
- static constexpr double step_ = 3./3;
+ static constexpr double step_ = 5;
const double maxx = _config->max_input();
const double step = step_ / c.x();
@@ -266,7 +266,15 @@ void spline_widget::paintEvent(QPaintEvent *e)
QPainter p(this);
- if (_background.isNull())
+ if (!_background.isNull())
+ {
+ if (_background.size() != size())
+ {
+ _background = QPixmap();
+ _function = QPixmap();
+ }
+ }
+ else
{
_draw_function = true;
drawBackground();