summaryrefslogtreecommitdiffstats
path: root/src/libavoid
diff options
context:
space:
mode:
authorTomasz Boczkowski <penginsbacon@gmail.com>2015-05-09 11:38:22 +0000
committerTomasz Boczkowski <penginsbacon@gmail.com>2015-05-09 11:38:22 +0000
commitdb85d12f8c106586a0b11f60bf32cdb8ca75d8f2 (patch)
treeae5cbc2ad4fdbb93dbc1d7fc8b92ee2e2012e853 /src/libavoid
parentrenamed SPPattern methods to match coding style (diff)
parentfix crash introduces by recent rev when clipping (diff)
downloadinkscape-db85d12f8c106586a0b11f60bf32cdb8ca75d8f2.tar.gz
inkscape-db85d12f8c106586a0b11f60bf32cdb8ca75d8f2.zip
merged trunk
(bzr r14059.1.21)
Diffstat (limited to 'src/libavoid')
-rw-r--r--src/libavoid/connector.cpp6
-rw-r--r--src/libavoid/graph.cpp4
-rw-r--r--src/libavoid/orthogonal.cpp1
3 files changed, 4 insertions, 7 deletions
diff --git a/src/libavoid/connector.cpp b/src/libavoid/connector.cpp
index 40ded7498..36892c668 100644
--- a/src/libavoid/connector.cpp
+++ b/src/libavoid/connector.cpp
@@ -1476,7 +1476,6 @@ CrossingsInfoPair countRealCrossings(Avoid::Polygon& poly,
int prevTurnDir = -1;
int startCornerSide = 1;
int endCornerSide = 1;
- bool reversed = false;
if (!front_same)
{
// If there is a divergence at the beginning,
@@ -1485,7 +1484,6 @@ CrossingsInfoPair countRealCrossings(Avoid::Polygon& poly,
startCornerSide = Avoid::cornerSide(*c_path[0], *c_path[1],
*c_path[2], *p_path[0])
* segDir(*c_path[1], *c_path[2]);
- reversed = (startCornerSide != -prevTurnDir);
}
if (!back_same)
{
@@ -1497,7 +1495,6 @@ CrossingsInfoPair countRealCrossings(Avoid::Polygon& poly,
*c_path[size - 2], *c_path[size - 1],
*p_path[size - 1])
* segDir(*c_path[size - 3], *c_path[size - 2]);
- reversed = (endCornerSide != -prevTurnDir);
}
else
{
@@ -1578,10 +1575,9 @@ CrossingsInfoPair countRealCrossings(Avoid::Polygon& poly,
}
}
#endif
- prevTurnDir = 0;
if (pointOrders)
{
- reversed = false;
+ bool reversed = false;
size_t startPt = (front_same) ? 0 : 1;
// Orthogonal should always have at least one segment.
diff --git a/src/libavoid/graph.cpp b/src/libavoid/graph.cpp
index 728f8c085..5b617f123 100644
--- a/src/libavoid/graph.cpp
+++ b/src/libavoid/graph.cpp
@@ -129,7 +129,9 @@ static inline int orthogTurnOrder(const Point& a, const Point& b,
// Note: This method assumes the two Edges that share a common point.
bool EdgeInf::rotationLessThan(const VertInf *lastV, const EdgeInf *rhs) const
{
- if ((_v1 == rhs->_v1) && (_v2 == rhs->_v2))
+ assert(_v1 == rhs->_v1 || _v1 == rhs->_v2 || _v2 == rhs->_v1 || _v2 == rhs->_v2 );
+
+ if ((_v1 == rhs->_v1) && (_v2 == rhs->_v2))
{
// Effectively the same visibility edge, so they are equal.
return false;
diff --git a/src/libavoid/orthogonal.cpp b/src/libavoid/orthogonal.cpp
index b5ef8d7e8..466d1dd58 100644
--- a/src/libavoid/orthogonal.cpp
+++ b/src/libavoid/orthogonal.cpp
@@ -1548,7 +1548,6 @@ extern void generateStaticOrthogonalVisGraph(Router *router)
// Process the horizontal sweep
thisPos = (totalEvents > 0) ? events[0]->pos : 0;
posStartIndex = 0;
- posFinishIndex = 0;
for (unsigned i = 0; i <= totalEvents; ++i)
{
// If we have finished the current scanline or all events, then we