From 8ad5f7c39db55cab3f78fdefab323435261941fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sat, 16 Jun 2018 12:52:48 +0200 Subject: Add hovering to visualization. --- plugingui/painter.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'plugingui/painter.h') diff --git a/plugingui/painter.h b/plugingui/painter.h index fc4ce2b..2630b0c 100644 --- a/plugingui/painter.h +++ b/plugingui/painter.h @@ -29,11 +29,11 @@ #include #include "colour.h" +#include "pixelbuffer.h" namespace GUI { -class PixelBufferAlpha; class Font; class Drawable; class Image; @@ -60,6 +60,9 @@ public: void drawImageStretched(int x, int y, const Drawable& image, int width, int height); + template + void draw(Iterator begin, Iterator end, int x_offset, int y_offset, Colour const& colour); + typedef struct { Image* topLeft; Image* top; @@ -90,4 +93,13 @@ private: Colour colour; }; +template +void Painter::draw(Iterator begin, Iterator end, int x_offset, int y_offset, Colour const& colour) +{ + for (auto it = begin; it != end; ++it) + { + pixbuf.addPixel(x_offset + it->x, y_offset + it->y, colour); + } +} + } // GUI:: -- cgit v1.2.3