Skip to content

Commit

Permalink
fix #14413
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Feb 26, 2024
1 parent 12c4eb7 commit 6322c8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/geom/PositionVector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ PositionVector::intersectsAtLengths2D(const Position& lp1, const Position& lp2)

void
PositionVector::extrapolate(const double val, const bool onlyFirst, const bool onlyLast) {
if (size() > 0) {
if (size() > 1) {
Position& p1 = (*this)[0];
Position& p2 = (*this)[1];
const Position offset = (p2 - p1) * (val / p1.distanceTo(p2));
Expand All @@ -1137,7 +1137,7 @@ PositionVector::extrapolate(const double val, const bool onlyFirst, const bool o

void
PositionVector::extrapolate2D(const double val, const bool onlyFirst) {
if (size() > 0) {
if (size() > 1) {
Position& p1 = (*this)[0];
Position& p2 = (*this)[1];
if (p1.distanceTo2D(p2) > 0) {
Expand Down

0 comments on commit 6322c8c

Please sign in to comment.