From: Kaj-Michael Lang Date: Mon, 23 Jul 2007 10:42:30 +0000 (+0300) Subject: Draw the poi label a little nicer X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=206efc0897dc52c5464b6a10660956f2daa3facb;p=mapper Draw the poi label a little nicer --- diff --git a/src/map-poi.c b/src/map-poi.c index e7c7295..b273f5d 100644 --- a/src/map-poi.c +++ b/src/map-poi.c @@ -36,8 +36,11 @@ return TRUE; static void map_poi_title(gint x, gint y,gchar *title) { +gint w,h; + pango_layout_set_text(layout, title, -1); -gdk_draw_layout(_map_pixmap, _gc[COLORABLE_POI], x, y, layout); +pango_layout_get_pixel_size(layout, &w, &h); +gdk_draw_layout(_map_pixmap, _gc[COLORABLE_POI], x-(w>>1), y-h-_draw_width, layout); } static GdkPixbuf *map_poi_get_icon(gchar *icon) @@ -111,7 +114,7 @@ while (SQLITE_ROW == sqlite3_step(_stmt_select_poi)) { 3 * _draw_width, 3 * _draw_width); if (_zoom<3 && poi_label) - map_poi_title(poix - 10, poiy + _draw_width, poi_label); + map_poi_title(poix, poiy, poi_label); } else { gdk_draw_pixbuf(_map_pixmap, _gc[COLORABLE_POI],