]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[region] Couple more minor bugs in rectangle merge
authorCharlie Brej <cbrej@cs.man.ac.uk>
Sun, 22 Nov 2009 22:42:13 +0000 (22:42 +0000)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Sun, 22 Nov 2009 22:42:13 +0000 (22:42 +0000)
Also one redundant line. I think this code was never used in anger. There is a
major bug in the rectangle collision code which makes this detection ad-hoc.

src/libply/ply-region.c

index 8dd7558a793e25024cf25a4243441c81e3eb57f8..88194bdb55fd86e6c00d687b8334ccf950ca4f99 100644 (file)
@@ -199,14 +199,12 @@ merge_rectangle_with_sub_list (ply_region_t    *region,
 
               rectangle = copy_rectangle (new_area);
 
-              rectangle->y = old_area->y;
               rectangle->width = old_area->x - new_area->x;
               rectangle->height = (old_area->y + old_area->height) - new_area->y;
 
               merge_rectangle_with_sub_list (region, rectangle, next_node);
 
               new_area->height = (new_area->y + new_area->height) - (old_area->y + old_area->height);
-              new_area->width = new_area->width;
               new_area->y = old_area->y + old_area->height;
             }
           break;
@@ -241,8 +239,7 @@ merge_rectangle_with_sub_list (ply_region_t    *region,
            */
           case PLY_RECTANGLE_OVERLAP_BOTTOM_AND_SIDE_EDGES:
             {
-              old_area->height = (new_area->y + new_area->height)
-                                 - (old_area->y + old_area->height);
+              old_area->height = new_area->y - old_area->y;
             }
           break;