From 3f259e92bf1a25a8db521a587b6d612e356b22bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sun, 10 Jun 2018 15:13:53 +0200 Subject: Add highlight of single instruments on hits. --- plugingui/painter.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'plugingui/painter.cc') diff --git a/plugingui/painter.cc b/plugingui/painter.cc index 16e305f..acc92cb 100644 --- a/plugingui/painter.cc +++ b/plugingui/painter.cc @@ -401,11 +401,23 @@ void Painter::drawImage(int x0, int y0, const Drawable& image) assert(y0 + y >= 0); assert(x0 + x < pixbuf.width); assert(y0 + y < pixbuf.height); - pixbuf.addPixel(x0 + x, y0 + y, c); + + if (!has_restriction || c == restriction_colour) + { + pixbuf.addPixel(x0 + x, y0 + y, c); + } } } } +void Painter::drawRestrictedImage(int x0, int y0, Colour const& colour, const Drawable& image) +{ + has_restriction = true; + restriction_colour = colour; + drawImage(x0, y0, image); + has_restriction = false; +} + void Painter::drawImageStretched(int x0, int y0, const Drawable& image, int width, int height) { -- cgit v1.2.3