summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9336a24)
raw | patch | inline | side by side (parent: 9336a24)
author | joncruz <joncruz@users.sourceforge.net> | |
Fri, 23 Feb 2007 06:50:34 +0000 (06:50 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Fri, 23 Feb 2007 06:50:34 +0000 (06:50 +0000) |
src/widgets/icon.cpp | patch | blob | history |
diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp
index dd7770ac108aca16f27153c6628d89a08add51d9..adf876949c8c8daa1e82c70ac1b056a8aa84c80a 100644 (file)
--- a/src/widgets/icon.cpp
+++ b/src/widgets/icon.cpp
int const x1 = std::min(area->x + area->width, widget.allocation.x + padx + static_cast<int>(icon->psize) );
int const y1 = std::min(area->y + area->height, widget.allocation.y + pady + static_cast<int>(icon->psize) );
- gdk_draw_pixbuf(GDK_DRAWABLE(widget.window), NULL, image,
- x0 - widget.allocation.x - padx,
- y0 - widget.allocation.y - pady,
- x0, y0,
- x1 - x0, y1 - y0,
- GDK_RGB_DITHER_NORMAL, x0, y0);
+ int width = x1 - x0;
+ int height = y1 - y0;
+ // Limit drawing to when we actually have something. Avoids some crashes.
+ if ( (width > 0) && (height > 0) ) {
+ gdk_draw_pixbuf(GDK_DRAWABLE(widget.window), NULL, image,
+ x0 - widget.allocation.x - padx,
+ y0 - widget.allocation.y - pady,
+ x0, y0,
+ width, height,
+ GDK_RGB_DITHER_NORMAL, x0, y0);
+ }
}
}