diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-03-07 21:46:19 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-04-09 16:44:42 +0200 |
commit | d521dd29b038472aa1d2269def96fdf6663cf1b0 (patch) | |
tree | 77bcf64f657b3a099b1579700695925618d7b748 /plugingui/painter.h | |
parent | cf49b305a0c9e10a8b08ac626019f1502c5f12ee (diff) |
WIP: Experimental highlight stretching.
Diffstat (limited to 'plugingui/painter.h')
-rw-r--r-- | plugingui/painter.h | 24 |
1 files changed, 22 insertions, 2 deletions
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 <string> +#include <cmath> #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<typename Iterator> 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); + } } } |