summaryrefslogtreecommitdiff
path: root/navit/graphics.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-11-21 11:18:41 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-11-21 11:18:41 +0000
commit93ab2edaaf2f754a14ae868f8331d1db9c793378 (patch)
tree0df3e9bb689c61fe30072ca1398c59793291b30d /navit/graphics.c
parentf3f7be876a0c362b0bc49e5a1954104edcdb478f (diff)
downloadnavit-93ab2edaaf2f754a14ae868f8331d1db9c793378.tar.gz
Add:Core:Make absolute icon paths possible
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1739 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/graphics.c')
-rw-r--r--navit/graphics.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/navit/graphics.c b/navit/graphics.c
index 43b6d86c7..7d1fb4fb6 100644
--- a/navit/graphics.c
+++ b/navit/graphics.c
@@ -750,7 +750,10 @@ static void xdisplay_draw_elements(struct graphics *gra, GHashTable *display_lis
break;
case element_icon:
if (!img) {
- sprintf(path,"%s/xpm/%s", navit_sharedir, e->u.icon.src);
+ if (e->u.icon.src[0] == '/')
+ strcpy(path,e->u.icon.src);
+ else
+ sprintf(path,"%s/xpm/%s", navit_sharedir, e->u.icon.src);
img=graphics_image_new_scaled_rotated(gra, path, e->u.icon.width, e->u.icon.height, e->u.icon.rotation);
if (! img)
dbg(0,"failed to load icon '%s'\n", e->u.icon.src);
@@ -836,7 +839,10 @@ graphics_draw_itemgra(struct graphics *gra, struct itemgra *itm, struct transfor
}
break;
case element_icon:
- sprintf(path,"%s/xpm/%s", navit_sharedir, e->u.icon.src);
+ if (e->u.icon.src[0] == '/')
+ strcpy(path,e->u.icon.src);
+ else
+ sprintf(path,"%s/xpm/%s", navit_sharedir, e->u.icon.src);
img=graphics_image_new_scaled_rotated(gra, path, e->u.icon.width, e->u.icon.height, e->u.icon.rotation);
if (! img)
dbg(0,"failed to load icon '%s'\n", e->u.icon.src);