From bed56d73c7e6f64dd4b817003e369e862588c15f Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Sat, 13 Oct 2007 13:35:51 +0300 Subject: [PATCH] Use large icons when fully zoomed --- src/map-poi.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/map-poi.c b/src/map-poi.c index c2f0e2a..e680624 100644 --- a/src/map-poi.c +++ b/src/map-poi.c @@ -59,11 +59,13 @@ GError *error = NULL; if (icon==NULL) return NULL; -pixbuf = g_hash_table_lookup(poi_icon_hash, icon); +g_snprintf(buffer, sizeof(buffer), DATADIR "/map-icons/classic.%s/%s.png", + (_zoom==1) ? "big" : "small", icon); + +pixbuf = g_hash_table_lookup(poi_icon_hash, buffer); if (pixbuf) return pixbuf; -g_snprintf(buffer, sizeof(buffer), DATADIR "/map-icons/classic.small/%s.png", icon); pixbuf=gdk_pixbuf_new_from_file(buffer, &error); if (error) @@ -71,7 +73,7 @@ if (error) g_printf("Found POI icon: %s.png\n", buffer); -g_hash_table_insert(poi_icon_hash, g_strdup(icon), pixbuf); +g_hash_table_insert(poi_icon_hash, g_strdup(buffer), pixbuf); return pixbuf; } @@ -111,10 +113,12 @@ if (_zoom<2) { pango_font_description_set_size(fontdesc, POI_FONT_SIZE_BIG*PANGO_SCALE); pango_layout_set_font_description (layout, fontdesc); pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE); + pango_layout_set_width(layout, 90*PANGO_SCALE); } else { pango_font_description_set_size(fontdesc, POI_FONT_SIZE_SMALL*PANGO_SCALE); pango_layout_set_font_description (layout, fontdesc); pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END); + pango_layout_set_width(layout, 70*PANGO_SCALE); } while (SQLITE_ROW == sqlite3_step(poisql.select_poi)) { -- 2.39.5