From b975c992ba54bdfac1d2da6b9a5fd65c7f26b471 Mon Sep 17 00:00:00 2001 From: Jay Painter Date: Tue, 2 Jun 1998 03:22:28 +0000 Subject: [PATCH] fixed pixmap clipping in gtkclist --- ChangeLog | 4 ++++ ChangeLog.pre-2-0 | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-2 | 4 ++++ ChangeLog.pre-2-4 | 4 ++++ ChangeLog.pre-2-6 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ gtk/gtkclist.c | 40 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 68 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5822dd3df8..c19e0ebdbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Jun 1 20:24:42 PDT 1998 Jay Painter + * gtk/gtkclist.c: fixed clipping for pixmaps within rows... + finally. + Mon Jun 1 12:47:56 BST 1998 Tony Gale [1-1-0-Merge] diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 5822dd3df8..c19e0ebdbe 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,7 @@ +Mon Jun 1 20:24:42 PDT 1998 Jay Painter + * gtk/gtkclist.c: fixed clipping for pixmaps within rows... + finally. + Mon Jun 1 12:47:56 BST 1998 Tony Gale [1-1-0-Merge] diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 5822dd3df8..c19e0ebdbe 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +Mon Jun 1 20:24:42 PDT 1998 Jay Painter + * gtk/gtkclist.c: fixed clipping for pixmaps within rows... + finally. + Mon Jun 1 12:47:56 BST 1998 Tony Gale [1-1-0-Merge] diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 5822dd3df8..c19e0ebdbe 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,7 @@ +Mon Jun 1 20:24:42 PDT 1998 Jay Painter + * gtk/gtkclist.c: fixed clipping for pixmaps within rows... + finally. + Mon Jun 1 12:47:56 BST 1998 Tony Gale [1-1-0-Merge] diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 5822dd3df8..c19e0ebdbe 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,7 @@ +Mon Jun 1 20:24:42 PDT 1998 Jay Painter + * gtk/gtkclist.c: fixed clipping for pixmaps within rows... + finally. + Mon Jun 1 12:47:56 BST 1998 Tony Gale [1-1-0-Merge] diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 5822dd3df8..c19e0ebdbe 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,7 @@ +Mon Jun 1 20:24:42 PDT 1998 Jay Painter + * gtk/gtkclist.c: fixed clipping for pixmaps within rows... + finally. + Mon Jun 1 12:47:56 BST 1998 Tony Gale [1-1-0-Merge] diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 5822dd3df8..c19e0ebdbe 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +Mon Jun 1 20:24:42 PDT 1998 Jay Painter + * gtk/gtkclist.c: fixed clipping for pixmaps within rows... + finally. + Mon Jun 1 12:47:56 BST 1998 Tony Gale [1-1-0-Merge] diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index 25ff91e923..ee639e0cce 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -2679,6 +2679,26 @@ draw_row (GtkCList * clist, ydest = (clip_rectangle.y + (clip_rectangle.height / 2)) - height / 2 + clist_row->cell[i].vertical; + if (xdest < clip_rectangle.x) + { + xsrc = clip_rectangle.x - xdest; + pixmap_width -= xsrc; + xdest = clip_rectangle.x; + } + + if (xdest + pixmap_width > clip_rectangle.x + clip_rectangle.width) + pixmap_width = (clip_rectangle.x + clip_rectangle.width) - xdest; + + if (ydest < clip_rectangle.y) + { + ysrc = clip_rectangle.y - ydest; + height -= ysrc; + ydest = clip_rectangle.y; + } + + if (ydest + height > clip_rectangle.y + clip_rectangle.height) + height = (clip_rectangle.y + clip_rectangle.height) - ydest; + if (GTK_CELL_PIXMAP (clist_row->cell[i])->mask) { gdk_gc_set_clip_mask (fg_gc, GTK_CELL_PIXMAP (clist_row->cell[i])->mask); @@ -2707,6 +2727,26 @@ draw_row (GtkCList * clist, ydest = (clip_rectangle.y + (clip_rectangle.height / 2)) - height / 2 + clist_row->cell[i].vertical; + if (xdest < clip_rectangle.x) + { + xsrc = clip_rectangle.x - xdest; + pixmap_width -= xsrc; + xdest = clip_rectangle.x; + } + + if (xdest + pixmap_width > clip_rectangle.x + clip_rectangle.width) + pixmap_width = (clip_rectangle.x + clip_rectangle.width) - xdest; + + if (ydest < clip_rectangle.y) + { + ysrc = clip_rectangle.y - ydest; + height -= ysrc; + ydest = clip_rectangle.y; + } + + if (ydest + height > clip_rectangle.y + clip_rectangle.height) + height = (clip_rectangle.y + clip_rectangle.height) - ydest; + if (GTK_CELL_PIXTEXT (clist_row->cell[i])->mask) { gdk_gc_set_clip_mask (fg_gc, GTK_CELL_PIXTEXT (clist_row->cell[i])->mask);