diff options
author | André Nusser <andre.nusser@googlemail.com> | 2020-04-30 22:25:44 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2020-04-30 22:25:44 +0200 |
commit | 43ab0002e3048684b5661a5c341fc5f0e0f49f13 (patch) | |
tree | c4e4746836eb7654928ab2e652408664660e5b88 /plugingui/powerwidget.cc | |
parent | 224c50a694b831a6fe8f901d988f5156385716dc (diff) |
Mark last input and output in powermap widget.
Diffstat (limited to 'plugingui/powerwidget.cc')
-rw-r--r-- | plugingui/powerwidget.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugingui/powerwidget.cc b/plugingui/powerwidget.cc index 2d24fa0..7e8a904 100644 --- a/plugingui/powerwidget.cc +++ b/plugingui/powerwidget.cc @@ -105,6 +105,10 @@ PowerWidget::Canvas::Canvas(GUI::Widget* parent, this, &PowerWidget::Canvas::parameterChangedFloat); CONNECT(this, settings_notifier.powermap_shelf, this, &PowerWidget::Canvas::parameterChangedBool); + CONNECT(this, settings_notifier.powermap_input, + this, &PowerWidget::Canvas::parameterChangedFloat); + CONNECT(this, settings_notifier.powermap_output, + this, &PowerWidget::Canvas::parameterChangedFloat); parameterChangedFloat(0); } @@ -170,6 +174,16 @@ void PowerWidget::Canvas::repaintEvent(GUI::RepaintEvent *repaintEvent) p.drawLine(x0, y0 + height0, x0 + width0, y0); } + // draw the input/output of the last hit + if(settings.powermap_input.load() != -1 && settings.powermap_output.load() != -1) + { + p.setColour(GUI::Colour(.8f, 0.0f, .2f, .5f)); + p.drawLine(x0 + settings.powermap_input.load()*width0, y0 + height0, + x0 + settings.powermap_input.load()*width0, y0); + p.drawLine(x0, y0 + height0 - settings.powermap_output.load()*height0, + x0 + width0, y0 + height0 - settings.powermap_output.load()*height0); + } + // draw the fixed nodes of the spline float rad = radius * width(); p.setColour(GUI::Colour{0.0f, 1.0f, 0.0f, 0.7f}); |