Hello community,

here is the log from the commit of package libchamplain for openSUSE:Factory 
checked in at 2018-02-03 15:38:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libchamplain (Old)
 and      /work/SRC/openSUSE:Factory/.libchamplain.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libchamplain"

Sat Feb  3 15:38:31 2018 rev:51 rq:572079 version:0.12.16

Changes:
--------
--- /work/SRC/openSUSE:Factory/libchamplain/libchamplain.changes        
2017-09-13 21:43:25.571680813 +0200
+++ /work/SRC/openSUSE:Factory/.libchamplain.new/libchamplain.changes   
2018-02-03 15:38:32.564468238 +0100
@@ -1,0 +2,12 @@
+Sun Jan 28 23:43:23 UTC 2018 - [email protected]
+
+- Add
+  libchamplain-Fix-wrapping-champlain_view_x_to_longitude.patch:
+  Fix wrapping in champlain_view_x_to_longitude. Previous
+  implementation assumed that after using x_to_wrap_x further
+  wrapping would be needed only if x + priv->viewport_x >= width.
+- Do minor spec cleanup, use autosetup, make_build and make_install
+  macros, drop obsolete and unused BUILD_FROM_VCS conditional
+  gnome-common and gtk-doc BuildRequires and autogen.sh call.
+
+-------------------------------------------------------------------

New:
----
  libchamplain-Fix-wrapping-champlain_view_x_to_longitude.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libchamplain.spec ++++++
--- /var/tmp/diff_new_pack.znrHyJ/_old  2018-02-03 15:38:33.324432742 +0100
+++ /var/tmp/diff_new_pack.znrHyJ/_new  2018-02-03 15:38:33.328432555 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package libchamplain
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,6 +24,9 @@
 Group:          Development/Libraries/GNOME
 Url:            http://projects.gnome.org/libchamplain/
 Source0:        
http://download.gnome.org/sources/libchamplain/0.12/%{name}-%{version}.tar.xz
+# PATCH-FIX-UPSTREAM 
libchamplain-Fix-wrapping-champlain_view_x_to_longitude.patch 
[email protected] -- Fix wrapping in champlain_view_x_to_longitude.
+Patch0:         libchamplain-Fix-wrapping-champlain_view_x_to_longitude.patch
+
 BuildRequires:  clutter-devel >= 1.12
 BuildRequires:  clutter-gtk-devel
 BuildRequires:  fdupes
@@ -35,10 +38,6 @@
 BuildRequires:  memphis-devel
 BuildRequires:  sqlite3-devel
 BuildRequires:  vala
-%if 0%{?BUILD_FROM_VCS}
-BuildRequires:  gnome-common
-BuildRequires:  gtk-doc
-%endif
 
 %description
 Libchamplain is a C library providing a ClutterActor to display maps. It
@@ -83,40 +82,33 @@
 OpenAerialMap and Maps for free.
 
 %prep
-%setup -q
-
-%if 0%{?BUILD_FROM_VCS}
-[ -x ./autogen.sh ] && NOCONFIGURE=1 ./autogen.sh
-%endif
+%autosetup -p1
 
 %build
 %configure \
         --disable-static \
-        --enable-vala
-make %{?_smp_mflags} V=1
+        --enable-vala \
+        %{nil}
+%make_build
 
 %install
-%makeinstall
+%make_install
 find %{buildroot} -type f -name "*.la" -delete -print
 %fdupes %{buildroot}%{_datadir}/gtk-doc
 
 %post -n libchamplain-0_12-0 -p /sbin/ldconfig
-
 %postun -n libchamplain-0_12-0 -p /sbin/ldconfig
 
 %files -n libchamplain-0_12-0
-%defattr(-, root, root)
 %doc AUTHORS ChangeLog COPYING NEWS
 %{_libdir}/libchamplain-0.12.so.*
 %{_libdir}/libchamplain-gtk-0.12.so.*
 
 %files -n typelib-1_0-Champlain-0_12
-%defattr(-,root,root)
 %{_libdir}/girepository-1.0/Champlain-0.12.typelib
 %{_libdir}/girepository-1.0/GtkChamplain-0.12.typelib
 
 %files devel
-%defattr(-, root, root)
 %{_libdir}/*.so
 %{_libdir}/pkgconfig/champlain-0.12.pc
 %{_libdir}/pkgconfig/champlain-gtk-0.12.pc

++++++ libchamplain-Fix-wrapping-champlain_view_x_to_longitude.patch ++++++
>From 122d872eddec278d3b21aa6088ee2d57981e7da8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= <[email protected]>
Date: Wed, 20 Dec 2017 00:00:00 +0000
Subject: Fix wrapping in champlain_view_x_to_longitude.

Previous implementation assumed that after using x_to_wrap_x further
wrapping would be needed only if x + priv->viewport_x >= width.
Unfortunately, this is not the case when priv->viewport_x is negative
and whole x + priv->viewport_x ends up negative.
---
 champlain/champlain-view.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 784d644..154b5eb 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -2471,18 +2471,17 @@ champlain_view_x_to_longitude (ChamplainView *view,
 
   g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), 0.0);
 
+  x += priv->viewport_x;
+
   if (priv->hwrap)
     {
       gdouble width = get_map_width (view);
       x = x_to_wrap_x (x, width);
-
-      if (x >= width - priv->viewport_x)
-        x -= width;
     }
 
   longitude = champlain_map_source_get_longitude (priv->map_source,
         priv->zoom_level,
-        x + priv->viewport_x);
+        x);
 
   return longitude;
 }
-- 
cgit v0.12


>From 602e52f5f32c6e5751653571b69105d389bfe125 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= <[email protected]>
Date: Sun, 31 Dec 2017 14:51:41 +0100
Subject: Create a wrap-aware get_longitude() function and use it everywhere in
 view

---
 champlain/champlain-view.c | 53 ++++++++++++++++++++++++++--------------------
 1 file changed, 30 insertions(+), 23 deletions(-)

diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 154b5eb..dd8b3bd 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -334,6 +334,26 @@ get_map_width (ChamplainView *view)
 }
 
 
+static gdouble
+get_longitude (ChamplainView *view,
+    guint zoom_level,
+    gdouble x)
+{
+  ChamplainViewPrivate *priv = view->priv;
+
+  DEBUG_LOG ()
+
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), 0.0);
+
+  if (priv->hwrap)
+    x = x_to_wrap_x (x, get_map_width (view));
+
+  return champlain_map_source_get_longitude (priv->map_source,
+        zoom_level,
+        x);
+}
+
+
 static void
 update_coords (ChamplainView *view,
     gdouble x,
@@ -346,7 +366,7 @@ update_coords (ChamplainView *view,
 
   priv->viewport_x = x;
   priv->viewport_y = y;
-  priv->longitude = champlain_map_source_get_longitude (priv->map_source,
+  priv->longitude = get_longitude (view,
         priv->zoom_level,
         x + priv->viewport_width / 2.0);
   priv->latitude = champlain_map_source_get_latitude (priv->map_source,
@@ -1440,7 +1460,7 @@ zoom_gesture_zoom_cb (ClutterZoomAction *gesture,
       dx = (priv->viewport_width / 2.0) - focal_point->x;
       dy = (priv->viewport_height / 2.0) - focal_point->y;
 
-      lon = champlain_map_source_get_longitude (priv->map_source, zoom_level, 
focus.x + dx);
+      lon = get_longitude (view, zoom_level, focus.x + dx);
       lat = champlain_map_source_get_latitude (priv->map_source, zoom_level, 
focus.y + dy);
 
       champlain_view_center_on (view, lat, lon);
@@ -1830,7 +1850,7 @@ champlain_view_scroll (ChamplainView *view,
   y = priv->viewport_y + priv->viewport_height / 2.0 + deltay;
 
   lat = champlain_map_source_get_latitude (priv->map_source, priv->zoom_level, 
y);
-  lon = champlain_map_source_get_longitude (priv->map_source, 
priv->zoom_level, x);
+  lon = get_longitude (view, priv->zoom_level, x);
 
   if (priv->kinetic_mode)
     champlain_view_go_to_with_duration (view, lat, lon, 300);
@@ -2465,25 +2485,12 @@ champlain_view_x_to_longitude (ChamplainView *view,
     gdouble x)
 {
   ChamplainViewPrivate *priv = view->priv;
-  gdouble longitude;
 
   DEBUG_LOG ()
 
   g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), 0.0);
 
-  x += priv->viewport_x;
-
-  if (priv->hwrap)
-    {
-      gdouble width = get_map_width (view);
-      x = x_to_wrap_x (x, width);
-    }
-
-  longitude = champlain_map_source_get_longitude (priv->map_source,
-        priv->zoom_level,
-        x);
-
-  return longitude;
+  return get_longitude (view, priv->zoom_level, x + priv->viewport_x);
 }
 
 
@@ -4036,12 +4043,12 @@ get_bounding_box (ChamplainView *view,
   bbox->bottom = champlain_map_source_get_latitude (priv->map_source,
                                                     zoom_level,
                                                     y + priv->viewport_height);
-  bbox->left = champlain_map_source_get_longitude (priv->map_source,
-                                                   zoom_level,
-                                                   x);
-  bbox->right = champlain_map_source_get_longitude (priv->map_source,
-                                                    zoom_level,
-                                                    x + priv->viewport_width);
+  bbox->left = get_longitude (view,
+                              zoom_level,
+                              x);
+  bbox->right = get_longitude (view,
+                               zoom_level,
+                               x + priv->viewport_width);
   return bbox;
 }
 
-- 
cgit v0.12


>From 8752cbe1825a301418451c4cf2e20d8577308c93 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= <[email protected]>
Date: Sun, 31 Dec 2017 14:57:34 +0100
Subject: Properly wrap coordinates in champlain_view_center_on()

---
 champlain/champlain-view.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index dd8b3bd..4edabef 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -1950,7 +1950,10 @@ champlain_view_center_on (ChamplainView *view,
 
   DEBUG ("Centering on %f, %f (%g, %g)", latitude, longitude, x, y);
 
-  position_viewport (view, x, y);
+  if (priv->hwrap)
+    position_viewport (view, x_to_wrap_x (x, get_map_width (view)), y);
+  else
+    position_viewport (view, x, y);
   load_visible_tiles (view, FALSE);
 }
 
-- 
cgit v0.12


Reply via email to