From 206efc0897dc52c5464b6a10660956f2daa3facb Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Mon, 23 Jul 2007 13:42:30 +0300 Subject: [PATCH] Draw the poi label a little nicer --- src/map-poi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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], -- 2.39.5