diff options
author | André Nusser <andre.nusser@googlemail.com> | 2018-06-10 15:13:53 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-08-12 11:13:52 +0200 |
commit | 3f259e92bf1a25a8db521a587b6d612e356b22bc (patch) | |
tree | 4c3d312028bcad0b0586003ed9702d4e6c38d1f8 /plugingui/painter.cc | |
parent | d5c2ccc687a38e607b3532f4eb3eafa95d3b887a (diff) |
Add highlight of single instruments on hits.
Diffstat (limited to 'plugingui/painter.cc')
-rw-r--r-- | plugingui/painter.cc | 14 |
1 files changed, 13 insertions, 1 deletions
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) { |