From d521dd29b038472aa1d2269def96fdf6663cf1b0 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 7 Mar 2020 21:46:19 +0100 Subject: WIP: Experimental highlight stretching. --- plugingui/painter.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'plugingui/painter.h') diff --git a/plugingui/painter.h b/plugingui/painter.h index 3bdbe2d..a1ea6f1 100644 --- a/plugingui/painter.h +++ b/plugingui/painter.h @@ -27,6 +27,7 @@ #pragma once #include +#include #include "colour.h" #include "pixelbuffer.h" @@ -64,6 +65,10 @@ public: void drawImage(int x, int y, const Drawable& image); void drawRestrictedImage(int x0, int y0, const Colour& restriction_colour, const Drawable& image); + void drawRestrictedImageStretched(int x0, int y0, + const Colour& restriction_colour, + const Drawable& image, + int width, int height, Filter filter); void drawImageStretched(int x, int y, const Drawable& image, int width, int height, Filter filter = Filter::Nearest); @@ -101,9 +106,24 @@ private: template void Painter::draw(Iterator begin, Iterator end, int x_offset, int y_offset, Colour const& colour, double scale) { - for (auto it = begin; it != end; ++it) + if(scale > 1) { - pixbuf.addPixel(x_offset + it->x * scale, y_offset + it->y * scale, colour); + auto tmp = this->colour; + setColour(colour); + for (auto it = begin; it != end; ++it) + { + drawFilledCircle(x_offset + it->x * scale, y_offset + it->y * scale, + std::ceil(scale)); + } + setColour(tmp); + } + else + { + for (auto it = begin; it != end; ++it) + { + pixbuf.addPixel(x_offset + it->x * scale, y_offset + it->y * scale, + colour); + } } } -- cgit v1.2.3