From 43ab0002e3048684b5661a5c341fc5f0e0f49f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Thu, 30 Apr 2020 22:25:44 +0200 Subject: Mark last input and output in powermap widget. --- plugingui/powerwidget.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'plugingui/powerwidget.cc') 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}); -- cgit v1.2.3