Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63250 - trunk/boost/polygon/detail
From: lucanus.j.simonson_at_[hidden]
Date: 2010-06-22 17:59:08


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

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

Modified: trunk/boost/polygon/detail/polygon_45_formation.hpp
==============================================================================
--- trunk/boost/polygon/detail/polygon_45_formation.hpp (original)
+++ trunk/boost/polygon/detail/polygon_45_formation.hpp 2010-06-22 17:59:08 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