diff options
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) { |