Skip to content
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

Fix "empty hole" quirks #2225

Merged
merged 3 commits into from
Apr 14, 2024
Merged

Fix "empty hole" quirks #2225

merged 3 commits into from
Apr 14, 2024

Conversation

dg0yt
Copy link
Member

@dg0yt dg0yt commented Apr 14, 2024

The crash fixed in GH-2224/GH-2144 had an OCD import aspect (data source) and an map editor aspect (data usage). This PR adresses the second aspect. While it was easy to locate the crash and its trigger, a confusing fact was that the path part data in the map editor wasn't the same as the data observed while debugging the OCD import. It furned out that the initial calculation of map parts in PathObject::recalculateParts() (expected data) was overwritten by PathObject::updatePathCoords() (actual data).

This PR aligns map part calulation in the second function with the first function, and a adds a basic test. This fixes the crash.

There is a certain risk that this creates new problems. But the generated data is fairly reasonable now.

dg0yt added 3 commits April 14, 2024 12:43
If input data has invalid hole points, do not prepend them to the
following path part, but create an empty path part instead.

This prevents crashes in locations where the part end is expected
to never be before path start. The empty path part might be another
source of problems, but it is an artifact which is already produced
by recalculateParts() (incl. the PathObject constructor).
@dg0yt dg0yt merged commit b4fa28c into OpenOrienteering:master Apr 14, 2024
12 checks passed
@dg0yt
Copy link
Member Author

dg0yt commented Apr 14, 2024

This wasn't meant to be merged so quickly, but...

@dg0yt dg0yt deleted the path-parts branch April 14, 2024 16:12
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