diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-04-25 14:57:47 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-04-25 14:57:47 +0200 |
commit | d762ec9f9fef7636602b73e11ddfc1842f377e92 (patch) | |
tree | d80034fa422961616a5ef61cf2a749b7d4d00288 | |
parent | 22a635734609e4fb657f4715586bc0c71fe50670 (diff) |
WIP: Improve point interaction and visualisation.
-rw-r--r-- | plugingui/powerwidget.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/plugingui/powerwidget.cc b/plugingui/powerwidget.cc index 675d6db..ec7e498 100644 --- a/plugingui/powerwidget.cc +++ b/plugingui/powerwidget.cc @@ -181,11 +181,13 @@ void PowerWidget::Canvas::repaintEvent(GUI::RepaintEvent *repaintEvent) // draw the fixed nodes of the spline float rad = radius * width(); - p.setColour(GUI::Colour{0.f, 0.7f, .5f, 1.f}); + p.setColour(GUI::Colour{0.0f, 0.7f, 0.5f, 1.0f}); p.drawFilledCircle(settings.fixed0_x.load() * width(), height() - settings.fixed0_y.load() * height(), rad); + p.setColour(GUI::Colour{0.5f, 0.7f, 0.0f, 1.0f}); p.drawFilledCircle(settings.fixed1_x.load() * width(), height() - settings.fixed1_y.load() * height(), rad); + p.setColour(GUI::Colour{0.5f, 0.0f, 0.7f, 1.0f}); p.drawFilledCircle(settings.fixed2_x.load() * width(), height() - settings.fixed2_y.load() * height(), rad); @@ -229,20 +231,20 @@ void PowerWidget::Canvas::buttonEvent(GUI::ButtonEvent* buttonEvent) in_point = -1; break; case GUI::Direction::down: - if(std::abs(x0 - settings.fixed0_x.load()) < radius && - std::abs(y0 - settings.fixed0_y.load()) < radius) + if(std::abs(x0 - settings.fixed0_x.load()) < radius * 1.5 && + std::abs(y0 - settings.fixed0_y.load()) < radius * 1.5) { in_point = 0; } - if(std::abs(x0 - settings.fixed1_x.load()) < radius && - std::abs(y0 - settings.fixed1_y.load()) < radius) + if(std::abs(x0 - settings.fixed1_x.load()) < radius * 1.5 && + std::abs(y0 - settings.fixed1_y.load()) < radius * 1.5) { in_point = 1; } - if(std::abs(x0 - settings.fixed2_x.load()) < radius && - std::abs(y0 - settings.fixed2_y.load()) < radius) + if(std::abs(x0 - settings.fixed2_x.load()) < radius * 1.5 && + std::abs(y0 - settings.fixed2_y.load()) < radius * 1.5) { in_point = 2; } |