diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-03-13 20:50:39 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-03-13 20:50:39 +0100 |
commit | f85065f15b5d4521ae57857aaafcdeb8fbc3bdb7 (patch) | |
tree | fa13250a84514aae4736bc8cba0dd2386e815585 /plugingui/painter.cc | |
parent | e7245e50b584a9e6ff43a8079ebac199aea1ec0c (diff) |
Add clear method. Fixed alpha bleding (again).
Diffstat (limited to 'plugingui/painter.cc')
-rw-r--r-- | plugingui/painter.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/plugingui/painter.cc b/plugingui/painter.cc index b74952f..e5da246 100644 --- a/plugingui/painter.cc +++ b/plugingui/painter.cc @@ -191,9 +191,16 @@ void GUI::Painter::drawRectangle(int x1, int y1, int x2, int y2) void GUI::Painter::drawFilledRectangle(int x1, int y1, int x2, int y2) { - for(int x = x1; x < x2; x++) { - for(int y = y1; y < y2; y++) { - drawPoint(x, y); + for(int y = y1; y < y2; y++) { + drawLine(x1, y, x2, y); + } +} + +void GUI::Painter::clear() +{ + for(int x = 0; x < pixbuf->width; x++) { + for(int y = 0; y < pixbuf->height; y++) { + pixbuf->setPixel(x, y, 0, 0, 0, 0); } } } |