# HG changeset patch # User Thinker K.F. Li # Date 1222278169 -28800 # Node ID 21db69d46835b33ae2d4db1ff58cb46a54d2d242 # Parent 3efe770071276020f0844085d8a9954cab088705 Fix the problem that left-upper side of a moving shape will be flashed. It is because a coord without member always have a {x=0, y=0, w=1, h=1} geometry value. It cause most left-upper corner been updated. It also cause Cairo to update minmum area that include all updated pixels. So, left-upper side of a updated shape will be updated by Cairo by copy application buffer to window. It causes cursor flashing. diff -r 3efe77007127 -r 21db69d46835 src/geo.c --- a/src/geo.c Wed Sep 24 23:40:40 2008 +0800 +++ b/src/geo.c Thu Sep 25 01:42:49 2008 +0800 @@ -20,12 +20,11 @@ } static int _is_overlay(area_t *r1, area_t *r2) { - if(!is_scale_overlay(r1->x, r1->w, r2->x, r2->w)) - return 0; - if(!is_scale_overlay(r1->y, r1->h, r2->y, r2->h)) - return 0; - - return 1; + if(is_scale_overlay(r1->x, r1->w, r2->x, r2->w) && + is_scale_overlay(r1->y, r1->h, r2->y, r2->h)) + return 1; + + return 0; } int is_overlay(area_t *r1, area_t *r2) { @@ -38,6 +37,14 @@ co_aix x, y; int i; + if(n_pos == 0) { + area->x = 0; + area->w = 0; + area->y = 0; + area->h = 0; + return; + } + min_x = max_x = pos[0][0]; min_y = max_y = pos[0][1]; for(i = 1; i < n_pos; i++) {