]> err.no Git - mapper/commitdiff
MapWidget: Add center mark size param, fix colors
authorKaj-Michael Lang <milang@tal.org>
Wed, 21 May 2008 11:43:04 +0000 (14:43 +0300)
committerKaj-Michael Lang <milang@tal.org>
Wed, 21 May 2008 11:43:04 +0000 (14:43 +0300)
src/gtkmap.c

index c355bb22d4d5fc5575895c7016784b83ee595548..7dc5c6dc3c2a71d4723af02430becb85736fdbe0 100644 (file)
@@ -111,6 +111,8 @@ struct _GtkMapPriv
        gboolean gl;
 
        GdkRectangle scale_rect;
+
+       guint center_mark_size;
        GdkRectangle center_rect;
 
        RepoData *curr_repo;
@@ -405,10 +407,10 @@ BOUND(priv->center.unity, priv->min_center.unity, priv->max_center.unity);
 priv->base_tilex=grid2tile((gint) pixel2grid((gint) unit2pixel((gint) priv->center.unitx)) - (gint) priv->screen_grids_halfwidth);
 priv->base_tiley=grid2tile(pixel2grid(unit2pixel(priv->center.unity)) - priv->screen_grids_halfheight);
 
-priv->center_rect.x=(priv->screen_width_pixels/2)-8;
-priv->center_rect.y=(priv->screen_height_pixels/2)-8;
-priv->center_rect.width=16;
-priv->center_rect.height=16;
+priv->center_rect.x=(priv->screen_width_pixels/2)-priv->center_mark_size/2;
+priv->center_rect.y=(priv->screen_height_pixels/2)-priv->center_mark_size/2;
+priv->center_rect.width=priv->center_mark_size;
+priv->center_rect.height=priv->center_mark_size;
 }
 
 /******************************************************************************/
@@ -502,6 +504,8 @@ priv->speed_gc=priv->speed_gc1;
 
 priv->units_conv=1.85200;
 
+priv->center_mark_size=8;
+
 priv->icache=image_cache_new(64);
 
 priv->show_scale=TRUE;
@@ -1125,17 +1129,15 @@ GtkMapPriv *priv;
 map=GTK_MAP(widget);
 priv=GTK_MAP_GET_PRIVATE(map);
 
-g_debug("CenterMark: %d %d %d %d", priv->center_rect.x, priv->center_rect.y, priv->center_rect.width, priv->center_rect.height);
-
 if (!gdk_rectangle_intersect(&event->area, &priv->center_rect, NULL))
        return;
 
 #ifdef WITH_CAIRO
 cairo_save(priv->ct);
 cairo_rectangle(priv->ct, priv->center_rect.x, priv->center_rect.y, priv->center_rect.width, priv->center_rect.height);
-cairo_set_source_rgb(priv->ct, 0.8, 0.8, 1);
+cairo_set_source_rgba(priv->ct, 1, 1, 1, 0.8);
 cairo_fill_preserve(priv->ct);
-cairo_set_source_rgba(priv->ct, 1, 1, 1, 0.5);
+cairo_set_source_rgba(priv->ct, 0, 0, 0, 0.5);
 cairo_stroke(priv->ct);
 cairo_restore(priv->ct);
 #else