diff options
author | Soeren Sandmann <sandmann@daimi.au.dk> | 2002-08-20 19:50:19 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2002-08-20 19:50:19 +0000 |
commit | 69705a6500d346262fd0d4c6feb4c276f6022e19 (patch) | |
tree | 96616b0d5da7ddeca9b21165f99f241cc5de8590 /gtk/gtkiconview.c | |
parent | 97d72aa4093b4d2c791616c36330430ccf2e73b7 (diff) | |
download | gtk+-69705a6500d346262fd0d4c6feb4c276f6022e19.tar.gz |
Fix buglet that sometimes left dirt in corner of the rubberband area.
2002-08-20 Soeren Sandmann <sandmann@daimi.au.dk>
* libegg/iconlist/eggiconlist.c (rubberbanding): Fix buglet that
sometimes left dirt in corner of the rubberband area.
Diffstat (limited to 'gtk/gtkiconview.c')
-rw-r--r-- | gtk/gtkiconview.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index fa3a91a7d1..20a345e993 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -905,7 +905,6 @@ rubberbanding (gpointer data) GdkRectangle old_area; GdkRectangle new_area; GdkRectangle common; - GdkRegion *common_region; GdkRegion *invalid_region; icon_list = EGG_ICON_LIST (data); @@ -929,30 +928,28 @@ rubberbanding (gpointer data) new_area.width = ABS (x - icon_list->priv->rubberband_x1) + 1; new_area.height = ABS (y - icon_list->priv->rubberband_y1) + 1; + invalid_region = gdk_region_rectangle (&old_area); + gdk_region_union_with_rect (invalid_region, &new_area); + gdk_rectangle_intersect (&old_area, &new_area, &common); - - /* always invalidate border */ - if (common.width > 2) + if (common.width > 2 && common.height > 2) { - common.width -= 2; + GdkRegion *common_region; + + /* make sure the border is invalidated */ common.x += 1; - } - - if (common.height > 2) - { common.y += 1; + common.width -= 2; common.height -= 2; - } + + common_region = gdk_region_rectangle (&common); - common_region = gdk_region_rectangle (&common); - - invalid_region = gdk_region_rectangle (&old_area); - gdk_region_union_with_rect (invalid_region, &new_area); - gdk_region_subtract (invalid_region, common_region); + gdk_region_subtract (invalid_region, common_region); + gdk_region_destroy (common_region); + } gdk_window_invalidate_region (icon_list->priv->bin_window, invalid_region, TRUE); - gdk_region_destroy (common_region); gdk_region_destroy (invalid_region); icon_list->priv->rubberband_x2 = x; |