Skip to content

Commit

Permalink
warped-map: fixes extendLine issue
Browse files Browse the repository at this point in the history
This commit fixes #7964.

The lengthToAdd value is supposed to be positive, and doesn't need to be
less than 1 in practice.
  • Loading branch information
jacomyal authored and SharglutDev committed Jul 5, 2024
1 parent b6df80a commit c3d986c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion front/src/common/Map/WarpedMap/core/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function getSamples(
* Given a line and a lengthToAdd, extend the line at its two extremities by lengthToAdd meters.
*/
export function extendLine(line: Feature<LineString>, lengthToAdd: number): Feature<LineString> {
if (lengthToAdd <= 1) throw new Error('lengthToAdd must be a positive');
if (lengthToAdd < 0) throw new Error('lengthToAdd must be positive');

const points = line.geometry.coordinates;
const firstPoint = points[0] as Vec2;
Expand Down

0 comments on commit c3d986c

Please sign in to comment.