diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-15 10:19:20 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-18 18:48:42 +0200 |
commit | 7d84db6caa0f56f785b9abf7920ca4c58c70a2fd (patch) | |
tree | c3ad00971f3a9f9bc2f7057c0ac1f93ea203d4ba | |
parent | d405b91787ecb332d4ecb8740c06ca84f7e8a6b3 (diff) |
spline: speed up Qt spline ops
-rw-r--r-- | spline/spline-widget.cpp | 12 |
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(); |