Skip to content

Fix stray gridlines across windowed genper maps - #9309

Merged
Esteban82 merged 2 commits into
masterfrom
fix-genper-gridlines
Nov 19, 2026
Merged

Esteban82 merged 2 commits into
masterfrom
fix-genper-gridlines

Conversation

@Esteban82

Copy link
Copy Markdown
Member

My goal was to remove the GMT_KNOWN_FAILURE flag from test/genper/gridlines2.sh. Claude suggested the fix and the explanation below.

Bug: in windowed -JG maps, gmtmap_genper_crossing and gmtmap_genperw_overlap overwrote this_x_status/this_y_status. Gridline segments behind the horizon were then taken as crossings and drew straight chords across the map and an arc outside the frame. It affects any windowed genper view whose gridlines cross the horizon.

Fix: save and restore the status in both functions (4 lines in gmt_map.c).

This PR re-enable gridlines2.sh and replace its baseline, with the corrected output.

Tested with:
gmt psbasemap -Rg -JG225.989/80.319/6166.78/0/0/54.628/68.2/68.2/6i -Bxa30f10g10 -Bya5f5g5 -png map

Before and after:
map_bugmap_fix

🤖 Generated with Claude Opus 5.5.

Esteban82 and others added 2 commits November 18, 2026 19:37
gmtmap_genper_crossing and gmtmap_genperw_overlap call the radial and
rectangular *_outside tests, which overwrite this_x_status/this_y_status.
For a point beyond the horizon whose projection falls inside the window,
the status became "inside", gmt_map_outside then copied it to prev_*,
and gmtmap_crossing reported a crossing on every segment behind the
horizon. gmtmap_radial_crossing then extrapolated those crossings,
drawing straight chords across the map and an arc outside the frame.

Save and restore the status around the tests in both functions, and
drop the GMT_KNOWN_FAILURE flag from test/genper/gridlines2.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Esteban82 Esteban82 added bug Something isn't working maintenance Boring but important stuff for the core devs labels Nov 19, 2026
@Esteban82
Esteban82 requested review from a team, joa-quim and seisman November 19, 2026 14:34

@joa-quim joa-quim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very small changes for a fix. I love those.

@Esteban82
Esteban82 merged commit 9230fc5 into master Nov 19, 2026
19 of 21 checks passed
@Esteban82
Esteban82 deleted the fix-genper-gridlines branch November 19, 2026 18:29
@Esteban82

Copy link
Copy Markdown
Member Author

Yes, and I'll make another one soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working maintenance Boring but important stuff for the core devs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants