Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63251 - branches/release/boost/polygon/detail
From: lucanus.j.simonson_at_[hidden]
Date: 2010-06-22 17:59:24


Author: ljsimons
Date: 2010-06-22 17:59:24 EDT (Tue, 22 Jun 2010)
New Revision: 63251
URL: http://svn.boost.org/trac/boost/changeset/63251

Log:
fixing colinear and duplicate points in hole fracturing of 45-degree polygons
Text files modified:
   branches/release/boost/polygon/detail/polygon_45_formation.hpp | 8 ++++++--
   1 files changed, 6 insertions(+), 2 deletions(-)

Modified: branches/release/boost/polygon/detail/polygon_45_formation.hpp
==============================================================================
--- branches/release/boost/polygon/detail/polygon_45_formation.hpp (original)
+++ branches/release/boost/polygon/detail/polygon_45_formation.hpp 2010-06-22 17:59:24 EDT (Tue, 22 Jun 2010)
@@ -251,12 +251,14 @@
             return;
           }
           Unit firstY = (*iter).y();
+ Unit firstX = (*iter).x();
           ++iter;
           if(iter == tailp_->points.end()) {
             tailp_->points.push_front(point);
             return;
           }
- if(iter->y() == point.y() && firstY == point.y()) {
+ if((iter->y() == point.y() && firstY == point.y()) ||
+ (iter->x() == point.x() && firstX == point.x())){
             --iter;
             *iter = point;
           } else {
@@ -274,12 +276,14 @@
           return;
         }
         Unit firstY = (*iter).y();
+ Unit firstX = (*iter).x();
         ++iter;
         if(iter == tailp_->points.rend()) {
           tailp_->points.push_back(point);
           return;
         }
- if(iter->y() == point.y() && firstY == point.y()) {
+ if((iter->y() == point.y() && firstY == point.y()) ||
+ (iter->x() == point.x() && firstX == point.x())){
           --iter;
           *iter = point;
         } else {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk