]> err.no Git - mapper/commitdiff
Draw the poi label a little nicer
authorKaj-Michael Lang <milang@angel.tal.org>
Mon, 23 Jul 2007 10:42:30 +0000 (13:42 +0300)
committerKaj-Michael Lang <milang@angel.tal.org>
Mon, 23 Jul 2007 10:42:30 +0000 (13:42 +0300)
src/map-poi.c

index e7c7295f03ba284b34f9c2fd7f6b88d251b516d9..b273f5d2e2412fb7369bc0d6c95ab96b9a685684 100644 (file)
@@ -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],