diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-04-25 15:06:47 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-04-25 15:06:47 +0200 |
commit | 486fafea19c459175eaff3e3f2339064028d399d (patch) | |
tree | b8c98be4449a824b065bb958ac780211f23cfc0a /plugingui/painter.cc | |
parent | d762ec9f9fef7636602b73e11ddfc1842f377e92 (diff) |
WIP: Show mapped points as circles.
Diffstat (limited to 'plugingui/painter.cc')
-rw-r--r-- | plugingui/painter.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugingui/painter.cc b/plugingui/painter.cc index bad5318..bc4abc3 100644 --- a/plugingui/painter.cc +++ b/plugingui/painter.cc @@ -252,7 +252,10 @@ void Painter::drawText(int x0, int y0, const Font& font, void Painter::drawPoint(int x, int y) { - pixbuf.setPixel(x, y, colour); + if(x >= 0 && y >= 0 && (std::size_t)x < pixbuf.width && (std::size_t)y < pixbuf.height) + { + pixbuf.setPixel(x, y, colour); + } } static void plot4points(Painter *p, int cx, int cy, int x, int y) |