]> err.no Git - mapper/commitdiff
Don't strdown the poi label.
authorKaj-Michael Lang <milang@angel.tal.org>
Sat, 21 Jul 2007 10:09:53 +0000 (13:09 +0300)
committerKaj-Michael Lang <milang@angel.tal.org>
Sat, 21 Jul 2007 10:09:53 +0000 (13:09 +0300)
Draw label only if we have one.

src/map-poi.c

index f729d6d3c0e537311623bad79cb8a86fb7cafb3e..e7c7295f03ba284b34f9c2fd7f6b88d251b516d9 100644 (file)
@@ -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);