summaryrefslogtreecommitdiff
path: root/plugingui/painter.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-03-13 20:50:39 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2013-03-13 20:50:39 +0100
commitf85065f15b5d4521ae57857aaafcdeb8fbc3bdb7 (patch)
treefa13250a84514aae4736bc8cba0dd2386e815585 /plugingui/painter.cc
parente7245e50b584a9e6ff43a8079ebac199aea1ec0c (diff)
Add clear method. Fixed alpha bleding (again).
Diffstat (limited to 'plugingui/painter.cc')
-rw-r--r--plugingui/painter.cc13
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);
}
}
}