[libchamplain] Make set_marker_depth () work correctly for southern hemisphere
- From: Jiří Techet <jiritechet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain] Make set_marker_depth () work correctly for southern hemisphere
- Date: Wed, 25 Aug 2010 20:31:45 +0000 (UTC)
commit 94715cb112af88c4de820771b2864cb9afc0118b
Author: JiÅ?Ã Techet <techet gmail com>
Date: Wed Aug 25 22:28:22 2010 +0200
Make set_marker_depth () work correctly for southern hemisphere
Signed-off-by: JiÅ?Ã Techet <techet gmail com>
champlain/champlain-layer.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/champlain/champlain-layer.c b/champlain/champlain-layer.c
index 3229756..909b54d 100644
--- a/champlain/champlain-layer.c
+++ b/champlain/champlain-layer.c
@@ -123,11 +123,13 @@ champlain_layer_init (ChamplainLayer *self)
* where the most north you are, the farther you are.
*/
static void
-set_marker_depth(GObject *marker)
+set_marker_depth (GObject *marker)
{
- gdouble lat;
+ gdouble lat, z;
+
g_object_get (G_OBJECT (marker), "latitude", &lat, NULL);
- clutter_actor_set_depth(CLUTTER_ACTOR(marker), 90.0 - lat);
+ z = (lat >= 0) ? 90.0 - lat : 90.0 + lat;
+ clutter_actor_set_depth (CLUTTER_ACTOR (marker), z);
}
@@ -136,7 +138,7 @@ marker_position_notify (GObject *gobject,
G_GNUC_UNUSED GParamSpec *pspec,
gpointer user_data)
{
- set_marker_depth(gobject);
+ set_marker_depth (gobject);
}
@@ -147,7 +149,7 @@ layer_add_cb (ClutterGroup *layer,
{
ChamplainBaseMarker *marker = CHAMPLAIN_BASE_MARKER (actor);
- set_marker_depth(G_OBJECT(actor));
+ set_marker_depth (G_OBJECT(actor));
g_signal_connect (G_OBJECT (marker), "notify::latitude",
G_CALLBACK (marker_position_notify), layer);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]