[polyclipping] Add patch for upstream bug 47

Volker Fröhlich volter at fedoraproject.org
Tue Jun 25 16:16:12 UTC 2013


commit d2f640dbbf34d9491f049b6628b53a737c5760fb
Author: Volker Fröhlich <volker27 at gmx.at>
Date:   Tue Jun 25 18:15:20 2013 +0200

    Add patch for upstream bug 47
    
    http://sourceforge.net/p/polyclipping/bugs/47/

 polyclipping-bug47.patch |   20 ++++++++++++++++++++
 polyclipping.spec        |    9 ++++++++-
 2 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/polyclipping-bug47.patch b/polyclipping-bug47.patch
new file mode 100644
index 0000000..d9d0788
--- /dev/null
+++ b/polyclipping-bug47.patch
@@ -0,0 +1,20 @@
+diff --git a/cpp/clipper.cpp b/cpp/clipper.cpp
+index 02a7b70..aa146ea 100644
+--- a/cpp/clipper.cpp
++++ b/cpp/clipper.cpp
+@@ -896,13 +896,14 @@ bool ClipperBase::AddPolygon(const Polygon &pg, PolyType polyType)
+     RangeTest(pg[i], maxVal);
+ 
+     if (i == 0 || PointsEqual(p[j], pg[i])) continue;
+-    else if (j > 0 && SlopesEqual(p[j-1], p[j], pg[i], m_UseFullRange))
++    else if (j > 0 && SlopesEqual(p[j-1], p[j], pg[i], maxVal == hiRange))
+     {
+       if (PointsEqual(p[j-1], pg[i])) j--;
+     } else j++;
+     p[j] = pg[i];
+   }
+   if (j < 2) return false;
++  m_UseFullRange = (maxVal == hiRange);
+ 
+   len = j+1;
+   while (len > 2)
diff --git a/polyclipping.spec b/polyclipping.spec
index 760bcad..09dc272 100644
--- a/polyclipping.spec
+++ b/polyclipping.spec
@@ -6,7 +6,7 @@
 
 Name:           polyclipping
 Version:        5.1.6
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Polygon clipping library
 
 Group:          System Environment/Libraries
@@ -14,6 +14,9 @@ License:        Boost
 URL:            http://sourceforge.net/projects/polyclipping
 Source0:        http://downloads.sourceforge.net/%{name}/clipper_ver%{version}.zip
 
+# http://sourceforge.net/p/polyclipping/bugs/47/
+Patch0:         %{name}-bug47.patch
+
 BuildRequires:  cmake
 BuildRequires:  dos2unix
 
@@ -38,6 +41,7 @@ developing applications that use %{name}.
 
 %prep
 %setup -qc
+%patch0 -p1
 
 # Delete binaries
 find . \( -name "*.exe" -o -name "*.dll" \) -delete
@@ -84,6 +88,9 @@ popd
 %{_libdir}/lib%{name}.so
 
 %changelog
+* Tue Jun 25 2013 Miro Hrončok <mhroncok at redhat.com> - 5.1.6-2
+- Added patch to solve upstream bug 47
+
 * Wed Jun  5 2013 Tom Hughes <tom at compton.nu> - 5.1.6-1
 - Update to 5.1.6 upstream release
 - Install agg_conv_clipper.h


More information about the scm-commits mailing list