summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-06-12 06:04:40 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-06-12 06:04:40 +0000
commit3febaff1e4f99e21bc4eebe57c800c6bb56524b6 (patch)
tree7a9f07294917565fee493eedbca5ac557ab4c862 /modules
parent411241fb2610f77a3b4d5bc3a9cfbd78a4a87312 (diff)
downloadgtk+-3febaff1e4f99e21bc4eebe57c800c6bb56524b6.tar.gz
Try to handle the situation that the borders are larger than the area we
2005-06-12 Matthias Clasen <mclasen@redhat.com> * pixbuf-render.c (theme_pixbuf_render): Try to handle the situation that the borders are larger than the area we are rendering. (#169731, Benjamin Otte)
Diffstat (limited to 'modules')
-rw-r--r--modules/engines/pixbuf/ChangeLog7
-rw-r--r--modules/engines/pixbuf/pixbuf-render.c18
2 files changed, 23 insertions, 2 deletions
diff --git a/modules/engines/pixbuf/ChangeLog b/modules/engines/pixbuf/ChangeLog
index a84900da7b..011dd7b938 100644
--- a/modules/engines/pixbuf/ChangeLog
+++ b/modules/engines/pixbuf/ChangeLog
@@ -1,3 +1,10 @@
+2005-06-12 Matthias Clasen <mclasen@redhat.com>
+
+ * pixbuf-render.c (theme_pixbuf_render): Try to
+ handle the situation that the borders are larger
+ than the area we are rendering. (#169731,
+ Benjamin Otte)
+
2005-01-08 Matthias Clasen <mclasen@redhat.com>
* === Released 2.6.1 ===
diff --git a/modules/engines/pixbuf/pixbuf-render.c b/modules/engines/pixbuf/pixbuf-render.c
index 03ec060834..4d965a057c 100644
--- a/modules/engines/pixbuf/pixbuf-render.c
+++ b/modules/engines/pixbuf/pixbuf-render.c
@@ -696,6 +696,9 @@ theme_pixbuf_render (ThemePixbuf *theme_pb,
if (theme_pb->stretch)
{
+ if (component_mask & COMPONENT_ALL)
+ component_mask = (COMPONENT_ALL - 1) & ~component_mask;
+
src_x[0] = 0;
src_x[1] = theme_pb->border_left;
src_x[2] = pixbuf_width - theme_pb->border_right;
@@ -711,13 +714,24 @@ theme_pixbuf_render (ThemePixbuf *theme_pb,
dest_x[2] = x + width - theme_pb->border_right;
dest_x[3] = x + width;
+ if (dest_x[1] > dest_x[2])
+ {
+ component_mask &= ~(COMPONENT_NORTH | COMPONENT_SOUTH | COMPONENT_CENTER);
+ dest_x[1] = dest_x[2] = (dest_x[1] + dest_x[2]) / 2;
+ }
+
dest_y[0] = y;
dest_y[1] = y + theme_pb->border_top;
dest_y[2] = y + height - theme_pb->border_bottom;
dest_y[3] = y + height;
- if (component_mask & COMPONENT_ALL)
- component_mask = (COMPONENT_ALL - 1) & ~component_mask;
+ if (dest_y[1] > dest_y[2])
+ {
+ component_mask &= ~(COMPONENT_EAST | COMPONENT_WEST | COMPONENT_CENTER);
+ dest_y[1] = dest_y[2] = (dest_y[1] + dest_y[2]) / 2;
+ }
+
+
#define RENDER_COMPONENT(X1,X2,Y1,Y2) \
pixbuf_render (pixbuf, theme_pb->hints[Y1][X1], window, mask, clip_rect, \