]> git.street.me.uk Git - andy/viking.git/commitdiff
Track Properties internal refactor: rename function to reflect what it really does.
authorRob Norris <rw_norris@hotmail.com>
Sat, 8 Jan 2011 13:34:45 +0000 (13:34 +0000)
committerRob Norris <rw_norris@hotmail.com>
Tue, 5 Apr 2011 23:47:23 +0000 (00:47 +0100)
src/viktrwlayer_propwin.c

index 48c3f6871b12783be455b23d30ea261dfb85c076..7a049d8f5d554b480eee88425576534fa9ac3087 100644 (file)
@@ -180,14 +180,14 @@ static VikTrackpoint *set_center_at_graph_position(gdouble event_x,
 /**
  * Returns whether the marker was drawn or not
  */
-static void draw_graph_mark (GtkWidget *image,
-                            gdouble event_x,
-                            gint img_width,
-                            GdkGC *gc,
-                            PropSaved *saved_img,
-                            gint PROFILE_WIDTH,
-                            gint PROFILE_HEIGHT,
-                            gboolean *marker_drawn)
+static void save_image_and_draw_graph_mark (GtkWidget *image,
+                                           gdouble event_x,
+                                           gint img_width,
+                                           GdkGC *gc,
+                                           PropSaved *saved_img,
+                                           gint PROFILE_WIDTH,
+                                           gint PROFILE_HEIGHT,
+                                           gboolean *marker_drawn)
 {
   GdkPixmap *pix = NULL;
   /* the pixmap = margin + graph area */
@@ -273,14 +273,14 @@ static void track_graph_click( GtkWidget *event_box, GdkEventButton *event, gpoi
   GtkWidget *window = gtk_widget_get_toplevel(GTK_WIDGET(event_box));
 
   VikTrackpoint *trackpoint = set_center_at_graph_position(event->x, event_box->allocation.width, widgets->vtl, vlp, vvp, tr, is_vt_graph, widgets->profile_width);
-  draw_graph_mark(image,
-                 event->x,
-                 event_box->allocation.width,
-                 window->style->black_gc,
-                 is_vt_graph ? &widgets->speed_graph_saved_img : &widgets->elev_graph_saved_img,
-                 widgets->profile_width,
-                 widgets->profile_height,
-                 &widgets->is_marker_drawn);
+  save_image_and_draw_graph_mark(image,
+                                event->x,
+                                event_box->allocation.width,
+                                window->style->black_gc,
+                                is_vt_graph ? &widgets->speed_graph_saved_img : &widgets->elev_graph_saved_img,
+                                widgets->profile_width,
+                                widgets->profile_height,
+                                &widgets->is_marker_drawn);
   g_list_free(child);
   widgets->marker_tp = trackpoint;
   gtk_dialog_set_response_sensitive(GTK_DIALOG(widgets->dialog), VIK_TRW_LAYER_PROPWIN_SPLIT_MARKER, widgets->is_marker_drawn);
@@ -302,14 +302,14 @@ static void track_graph_click( GtkWidget *event_box, GdkEventButton *event, gpoi
   }
   if (!isnan(pc)) {
     x2 = pc * widgets->profile_width + MARGIN + (event_box->allocation.width/2 - widgets->profile_width/2 - MARGIN/2);
-    draw_graph_mark(other_image,
-                   x2,
-                   event_box->allocation.width,
-                   window->style->black_gc,
-                   is_vt_graph ? &widgets->elev_graph_saved_img : &widgets->speed_graph_saved_img,
-                   widgets->profile_width,
-                   widgets->profile_height,
-                   &widgets->is_marker_drawn);
+    save_image_and_draw_graph_mark(other_image,
+                                  x2,
+                                  event_box->allocation.width,
+                                  window->style->black_gc,
+                                  is_vt_graph ? &widgets->elev_graph_saved_img : &widgets->speed_graph_saved_img,
+                                  widgets->profile_width,
+                                  widgets->profile_height,
+                                  &widgets->is_marker_drawn);
   }
 
   g_list_free(other_child);