Skip to content
Permalink
Browse files
fix potential exception in RPolyline::getLengthTo
  • Loading branch information
qcad committed Dec 15, 2015
1 parent 7430e81 commit eb26969
Showing 1 changed file with 4 additions and 1 deletion.
@@ -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.