Permalink
Browse files

fix potential exception in RPolyline::getLengthTo

  • Loading branch information...
qcad committed Dec 15, 2015
1 parent 7430e81 commit eb26969c4bd2a950879146051a296ad6faebbafe
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/core/math/RPolyline.cpp
@@ -947,13 +947,16 @@ double RPolyline::getLength() const {
}
double RPolyline::getLengthTo(const RVector& p) const {
double ret = 0.0;
double ret = -1.0;
if (p.equalsFuzzy(getStartPoint())) {
return ret;
}
int segIdx = getClosestSegment(p);
if (segIdx<0) {
return ret;
}
for (int i=0; i<segIdx; i++) {
double l = getSegmentAt(i)->getLength();

0 comments on commit eb26969

Please sign in to comment.