Fix:Core:Fixed bbox handling of images
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 27 Feb 2008 09:20:27 +0000 (09:20 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 27 Feb 2008 09:20:27 +0000 (09:20 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@915 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/src/graphics.c
navit/src/map.h

index 391b54f..aeb474e 100644 (file)
@@ -410,7 +410,10 @@ xdisplay_draw_elements(struct graphics *gra, GHashTable *display_list, struct it
                                        break;
                                case element_image:
                                        dbg(1,"image: '%s'\n", di->label);
-                                       gra->meth.draw_image_warp(gra->priv, gra->gc[0]->priv, di->pnt, di->count, di->label);
+                                       if (gra->meth.draw_image_warp)
+                                               gra->meth.draw_image_warp(gra->priv, gra->gc[0]->priv, di->pnt, di->count, di->label);
+                                       else
+                                               dbg(0,"draw_image_warp not supported by graphics driver drawing '%s'\ņ", di->label);
                                        break;
                                default:
                                        printf("Unhandled element type %d\n", e->type);
@@ -497,19 +500,9 @@ do_draw_map(struct displaylist *displaylist, struct transformation *t, struct ma
                                continue;
                        }
                } else {
-                       if (item->type == type_image && count == 2) {
-                               struct coord_rect r;
-                               r.lu=ca[0];
-                               r.rl=ca[1];
-                               if (! map_selection_contains_rect(sel, &r)) {
-                                       dbg(1,"image not visible\n");
-                                       continue;
-                               }
-                       } else {
-                               if (! map_selection_contains_polygon(sel, ca, count)) {
-                                       dbg(1,"polygon not visible\n");
-                                       continue;
-                               }
+                       if (! map_selection_contains_polygon(sel, ca, count)) {
+                               dbg(1,"polygon not visible\n");
+                               continue;
                        }
                }
                if (count == max) 
index 9d0a1e3..1dcc28b 100644 (file)
@@ -111,7 +111,7 @@ map_selection_contains_polygon(struct map_selection *sel, struct coord *c, int c
                return 0;
        r.lu=c[0];
        r.rl=c[0];
-       for (i = 1 ; i < count-1 ; i++) {
+       for (i = 1 ; i < count ; i++) {
                if (c[i].x < r.lu.x)
                        r.lu.x=c[i].x;
                if (c[i].x > r.rl.x)
@@ -124,7 +124,6 @@ map_selection_contains_polygon(struct map_selection *sel, struct coord *c, int c
        return map_selection_contains_rect(sel, &r);
 }
 
-
 /* prototypes */
 enum projection;
 struct attr;