]> mj.ucw.cz Git - leo.git/commitdiff
Labelling: Overlaps outside of map are not considered
authorKarryanna <karry@karryanna.cz>
Wed, 13 May 2015 16:52:00 +0000 (18:52 +0200)
committerKarryanna <karry@karryanna.cz>
Wed, 13 May 2015 16:52:00 +0000 (18:52 +0200)
labeller.c

index 1db25fca59721a57be2199c4e79154de98772460..1799bd0253ef7566e46d8c6ed9351ad4b2791b76 100644 (file)
@@ -1286,8 +1286,8 @@ int overlaps(struct placement *p1, struct placement *p2)
   int p2x = p2->x; int p2y = p2->y;
 
   int overlap = 0;
-  for (int y=max2(p1y, p2y); y<=min2(p1y+v1->height, p2y+v2->height); y++)
-    for (int x=max2(p1x, p2x); x<=min2(p1x+v1->width, p2x+v2->width); x++)
+  for (int y=max2(0, max2(p1y, p2y)); y<min2(page_height_int, min2(p1y+v1->height, p2y+v2->height)); y++)
+    for (int x=max2(0, max2(p1x, p2x)); x<min2(page_width_int, min2(p1x+v1->width, p2x+v2->width)); x++)
     {
       if (v1->bitmap[(y-p1y)*v1->width + (x-p1x)] &&
           v2->bitmap[(y-p2y)*v2->width + (x-p2x)])