diff options
author | André Nusser <andre.nusser@googlemail.com> | 2020-05-01 16:19:54 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2020-05-01 16:19:54 +0200 |
commit | 188479fa4111c5976ef4abd295cb130bfb5202dc (patch) | |
tree | a6ea400eb9ae990a62983d40b0055d98c48e4a4b /plugingui | |
parent | b14d676ad5ca9a9ee19b195dc631b8facd4e7ed9 (diff) |
Fix visualization issues in powerwidget due to rounding.
Diffstat (limited to 'plugingui')
-rw-r--r-- | plugingui/powerwidget.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/plugingui/powerwidget.cc b/plugingui/powerwidget.cc index 3f169d6..3c2ad93 100644 --- a/plugingui/powerwidget.cc +++ b/plugingui/powerwidget.cc @@ -196,22 +196,22 @@ void PowerWidget::Canvas::repaintEvent(GUI::RepaintEvent *repaintEvent) // draw the fixed nodes of the spline float rad = radius * width(); p.setColour(GUI::Colour{0.0f, 1.0f, 0.0f, 0.7f}); - p.drawFilledCircle(x0 + settings.powermap_fixed0_x.load() * width0, - y0 + height0 - settings.powermap_fixed0_y.load() * height0, rad); - p.drawCircle(x0 + power_map.getFixed0().in * width0, - y0 + height0 - power_map.getFixed0().out * height0, rad + 1); + p.drawFilledCircle(x0 + std::round(settings.powermap_fixed0_x.load() * width0), + y0 + height0 - std::round(settings.powermap_fixed0_y.load() * height0), rad); + p.drawCircle(x0 + std::round(power_map.getFixed0().in * width0), + y0 + height0 - std::round(power_map.getFixed0().out * height0), rad + 1); p.setColour(GUI::Colour{1.0f, 1.0f, 0.0f, 0.7f}); - p.drawFilledCircle(x0 + settings.powermap_fixed1_x.load() * width0, - y0 + height0 - settings.powermap_fixed1_y.load() * height0, rad); - p.drawCircle(x0 + power_map.getFixed1().in * width0, - y0 + height0 - power_map.getFixed1().out * height0, rad + 1); + p.drawFilledCircle(x0 + std::round(settings.powermap_fixed1_x.load() * width0), + y0 + height0 - std::round(settings.powermap_fixed1_y.load() * height0), rad); + p.drawCircle(x0 + std::round(power_map.getFixed1().in * width0), + y0 + height0 - std::round(power_map.getFixed1().out * height0), rad + 1); p.setColour(GUI::Colour{1.0f, 0.0f, 0.0f, 0.7f}); - p.drawFilledCircle(x0 + settings.powermap_fixed2_x.load() * width0, - y0 + height0 - settings.powermap_fixed2_y.load() * height0, rad); - p.drawCircle(x0 + power_map.getFixed2().in * width0, - y0 + height0 - power_map.getFixed2().out * height0, rad + 1); + p.drawFilledCircle(x0 + std::round(settings.powermap_fixed2_x.load() * width0), + y0 + height0 - std::round(settings.powermap_fixed2_y.load() * height0), rad); + p.drawCircle(x0 + std::round(power_map.getFixed2().in * width0), + y0 + height0 - std::round(power_map.getFixed2().out * height0), rad + 1); } void PowerWidget::Canvas::buttonEvent(GUI::ButtonEvent* buttonEvent) |