Skip to content

SplitPathCoord: Ensure monotony and bounds for at #2331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dg0yt
Copy link
Member

@dg0yt dg0yt commented Feb 2, 2025

For #2325. Test first.
Unlike #2325, this touches the behavior of a core function. While the change is reasonable IMHO, this may need more testing. Other parts of Mapper might implicitly rely on the broken cases.

Comment on lines -391 to +394
split.path_coord_index = path_coords.upperBound(length, first.path_coord_index, first.path_coords->size()-1);
if (length > first.clen)
{
split.path_coord_index = path_coords.upperBound(length, first.path_coord_index, first.path_coords->size()-1);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for monotony.

Comment on lines 408 to +414
if (qFuzzyCompare(1.0f + length, 1.0f + current_coord.clen) ||
qFuzzyCompare(1.0f + curve_length, 1.0f))
qFuzzyCompare(1.0f + curve_length, 1.0f) ||
length > current_coord.clen)
{
// Close match at current path coordinate,
// or near-zero curve length.
// or near-zero curve length,
// or length exceeding path length.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for upper bound.

Comment on lines +514 to -511

split.index = path_coords[split.path_coord_index].index;
}

split.index = path_coords[split.path_coord_index].index;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by change. When not entering the if branch, the right split.index is implied by initialization of split.

@dg0yt dg0yt requested a review from dl3sdo February 9, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant