From 6d6d15e1b328ec5c0469f8bc142848715b1491e8 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 12 Jan 2014 16:22:42 +0100 Subject: fix qfc display artifacts & bugs --- qfunctionconfigurator/qfunctionconfigurator.cpp | 13 ++++++------- qfunctionconfigurator/qfunctionconfigurator.h | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'qfunctionconfigurator') diff --git a/qfunctionconfigurator/qfunctionconfigurator.cpp b/qfunctionconfigurator/qfunctionconfigurator.cpp index 755e2f9c..6540e66f 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.cpp +++ b/qfunctionconfigurator/qfunctionconfigurator.cpp @@ -44,7 +44,8 @@ void QFunctionConfigurator::setConfig(FunctionConfig* config, QString settingsFi config->loadSettings(iniFile); _config = config; _draw_function = _draw_background = true; - this->update(); + update_range(); + update(); } void QFunctionConfigurator::loadSettings(QString settingsFile) { @@ -87,7 +88,7 @@ void QFunctionConfigurator::drawBackground() // horizontal grid - for (int i = 0; i < maxx; i += xstep) + for (int i = 0; i < maxy; i += xstep) { double y = range.height() - i * c.y() + range.y(); drawLine(&painter, @@ -102,7 +103,7 @@ void QFunctionConfigurator::drawBackground() } { - const int i = maxx; + const int i = maxy; double y = range.height() - i * c.y() + range.y(); drawLine(&painter, QPointF(range.x(), y), @@ -117,7 +118,7 @@ void QFunctionConfigurator::drawBackground() // vertical grid - for (int i = 0; i < maxy; i += ystep) + for (int i = 0; i < maxx; i += ystep) { double x = range.x() + i * c.x(); drawLine(&painter, @@ -132,7 +133,7 @@ void QFunctionConfigurator::drawBackground() text); } { - const int i = maxy; + const int i = maxx; double x = range.x() + i * c.x(); drawLine(&painter, QPointF(x, range.y()), @@ -415,8 +416,6 @@ void QFunctionConfigurator::setColorBezier(QColor color) void QFunctionConfigurator::resizeEvent(QResizeEvent *) { - _draw_background = true; - _draw_function = true; update_range(); repaint(); } diff --git a/qfunctionconfigurator/qfunctionconfigurator.h b/qfunctionconfigurator/qfunctionconfigurator.h index 17cb3a44..bb2aced0 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.h +++ b/qfunctionconfigurator/qfunctionconfigurator.h @@ -68,6 +68,7 @@ private: const double mwr = 15, mhr = 35; range = QRectF(mwl, mhl, (w - mwl - mwr), (h - mhl - mhr)); c = QPointF(range.width() / _config->maxInput(), range.height() / _config->maxOutput()); + _draw_function = _draw_background = true; } QRectF range; // The actual rectangle for the Bezier-curve -- cgit v1.2.3