summaryrefslogtreecommitdiffhomepage
path: root/qfunctionconfigurator
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-01-12 16:22:42 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-01-12 16:23:08 +0100
commit6d6d15e1b328ec5c0469f8bc142848715b1491e8 (patch)
treefd2e70a330979b94b205f79b80c4cc140322cfbe /qfunctionconfigurator
parentad708b8a8a2c8d2d898c79823672aba79de7733e (diff)
fix qfc display artifacts & bugs
Diffstat (limited to 'qfunctionconfigurator')
-rw-r--r--qfunctionconfigurator/qfunctionconfigurator.cpp13
-rw-r--r--qfunctionconfigurator/qfunctionconfigurator.h1
2 files changed, 7 insertions, 7 deletions
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