From ccf31fd8e9bced9dbc7a4fa751b6f0d337a9c7d3 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Sat, 21 Jul 2007 13:09:53 +0300 Subject: [PATCH] Don't strdown the poi label. Draw label only if we have one. --- src/map-poi.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/map-poi.c b/src/map-poi.c index f729d6d..e7c7295 100644 --- a/src/map-poi.c +++ b/src/map-poi.c @@ -92,7 +92,7 @@ if (SQLITE_OK != sqlite3_bind_double(_stmt_select_poi, 1, lat1) while (SQLITE_ROW == sqlite3_step(_stmt_select_poi)) { lat1 = sqlite3_column_double(_stmt_select_poi, 0); lon1 = sqlite3_column_double(_stmt_select_poi, 1); - gchar *poi_label = g_utf8_strdown(sqlite3_column_text(_stmt_select_poi, 3), -1); + gchar *poi_label = sqlite3_column_text(_stmt_select_poi, 3); gchar *cat_label = g_utf8_strdown(sqlite3_column_text(_stmt_select_poi, 6), -1); latlon2unit(lat1, lon1, unitx, unity); @@ -100,6 +100,7 @@ while (SQLITE_ROW == sqlite3_step(_stmt_select_poi)) { poiy = unit2bufy(unity); pixbuf=map_poi_get_icon(cat_label); + g_free(cat_label); if (!pixbuf) { /* No icon for POI or for category - draw default. */ @@ -109,21 +110,17 @@ while (SQLITE_ROW == sqlite3_step(_stmt_select_poi)) { poiy - (gint) (1.5f * _draw_width), 3 * _draw_width, 3 * _draw_width); - if (_zoom<3) - map_poi_title(poix, poiy + 4, poi_label); + if (_zoom<3 && poi_label) + map_poi_title(poix - 10, poiy + _draw_width, poi_label); } else { gdk_draw_pixbuf(_map_pixmap, _gc[COLORABLE_POI], pixbuf, 0, 0, - poix - gdk_pixbuf_get_width(pixbuf) / - 2, - poiy - gdk_pixbuf_get_height(pixbuf) / - 2, -1, -1, GDK_RGB_DITHER_NONE, + poix - gdk_pixbuf_get_width(pixbuf) / 2, + poiy - gdk_pixbuf_get_height(pixbuf) / 2, + -1, -1, GDK_RGB_DITHER_NONE, 0, 0); } - - g_free(poi_label); - g_free(cat_label); } sqlite3_reset(_stmt_select_poi); -- 2.39.5