--- trunk/src/map-tool.c 2009/08/17 10:51:56 58 +++ trunk/src/map-tool.c 2009/08/17 14:23:38 59 @@ -304,6 +304,8 @@ cairo_paint(cr); } +#define LINE_SKIP 10 + static void balloon_draw_cb(cairo_t *cr, OsmGpsMapRect_t *rect, gpointer data) { cache_t *cache = (cache_t*)data; @@ -336,16 +338,31 @@ cairo_set_font_size (cr, 20.0); cairo_text_extents (cr, cache->id, &extents); - /* draw right of icon vertically centered */ + /* display id right of icon vertically centered */ x += gdk_pixbuf_get_width(icon) + 5; y += (gdk_pixbuf_get_height(icon) + extents.height)/2; - cairo_move_to (cr, x,y); - printf("trying to draw %s\n", cache->id); cairo_set_source_rgba (cr, 0, 0, 0, 1); cairo_show_text (cr, cache->id); cairo_stroke (cr); + + /* return to the left border and below icon/text */ + x = rect->x; + y += (gdk_pixbuf_get_height(icon) - extents.height)/2 + LINE_SKIP; + + cairo_select_font_face (cr, "Sans", + CAIRO_FONT_SLANT_NORMAL, + CAIRO_FONT_WEIGHT_NORMAL); + cairo_set_font_size (cr, 14.0); + cairo_text_extents (cr, cache->name, &extents); + + cairo_move_to (cr, x,y); + cairo_show_text (cr, cache->name); + cairo_stroke (cr); + /* return to the left border and below text */ + x = rect->x; + y += extents.height + LINE_SKIP; } static gboolean