[libshumate] view: Trivial code shuffling



commit 42b029b1b4c7d759623851590f6bb88be6494bfd
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Mar 4 21:29:37 2021 -0300

    view: Trivial code shuffling
    
    Move shumate_view_go_to_with_duration() to up in the file.

 shumate/shumate-view.c | 69 +++++++++++++++++++++++++-------------------------
 1 file changed, 34 insertions(+), 35 deletions(-)
---
diff --git a/shumate/shumate-view.c b/shumate/shumate-view.c
index b3c7986..75a8f9c 100644
--- a/shumate/shumate-view.c
+++ b/shumate/shumate-view.c
@@ -466,6 +466,40 @@ on_motion_controller_motion (ShumateView              *self,
   priv->current_y = y;
 }
 
+static void
+shumate_view_go_to_with_duration (ShumateView *view,
+                                  double       latitude,
+                                  double       longitude,
+                                  guint        duration) /* In ms */
+{
+  ShumateViewPrivate *priv = shumate_view_get_instance_private (view);
+  GoToContext *ctx;
+
+  g_return_if_fail (SHUMATE_IS_VIEW (view));
+
+  if (duration == 0)
+    {
+      shumate_view_center_on (view, latitude, longitude);
+      return;
+    }
+
+  shumate_view_stop_go_to (view);
+
+  ctx = g_slice_new (GoToContext);
+  ctx->start_us = g_get_monotonic_time ();
+  ctx->duration_us = ms_to_us (duration);
+  ctx->from_latitude = shumate_location_get_latitude (SHUMATE_LOCATION (priv->viewport));
+  ctx->from_longitude = shumate_location_get_longitude (SHUMATE_LOCATION (priv->viewport));
+  ctx->to_latitude = latitude;
+  ctx->to_longitude = longitude;
+  ctx->view = view;
+
+  /* We keep a reference for stop */
+  priv->goto_context = ctx;
+
+  ctx->tick_id = gtk_widget_add_tick_callback (GTK_WIDGET (view), go_to_tick_cb, ctx, NULL);
+}
+
 static void
 shumate_view_get_property (GObject *object,
     guint prop_id,
@@ -918,41 +952,6 @@ shumate_view_go_to (ShumateView *view,
   shumate_view_go_to_with_duration (view, latitude, longitude, duration);
 }
 
-
-static void
-shumate_view_go_to_with_duration (ShumateView *view,
-                                  double      latitude,
-                                  double      longitude,
-                                  guint        duration) /* In ms */
-{
-  ShumateViewPrivate *priv = shumate_view_get_instance_private (view);
-  GoToContext *ctx;
-
-  g_return_if_fail (SHUMATE_IS_VIEW (view));
-
-  if (duration == 0)
-    {
-      shumate_view_center_on (view, latitude, longitude);
-      return;
-    }
-
-  shumate_view_stop_go_to (view);
-
-  ctx = g_slice_new (GoToContext);
-  ctx->start_us = g_get_monotonic_time ();
-  ctx->duration_us = ms_to_us (duration);
-  ctx->from_latitude = shumate_location_get_latitude (SHUMATE_LOCATION (priv->viewport));
-  ctx->from_longitude = shumate_location_get_longitude (SHUMATE_LOCATION (priv->viewport));
-  ctx->to_latitude = latitude;
-  ctx->to_longitude = longitude;
-  ctx->view = view;
-
-  /* We keep a reference for stop */
-  priv->goto_context = ctx;
-
-  ctx->tick_id = gtk_widget_add_tick_callback (GTK_WIDGET (view), go_to_tick_cb, ctx, NULL);
-}
-
 /**
  * shumate_view_get_go_to_duration:
  * @self: a #ShumateView


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]