Skip to content

Fix unfilled vector head in auto-legend when fill comes from +g<fill> - #9168

Merged
Esteban82 merged 2 commits into
masterfrom
fix-9167
Aug 30, 2026
Merged

Fix unfilled vector head in auto-legend when fill comes from +g<fill>#9168
Esteban82 merged 2 commits into
masterfrom
fix-9167

Conversation

@Esteban82

@Esteban82 Esteban82 commented Aug 29, 2026

Copy link
Copy Markdown
Member

When a vector symbol's head fill is set via the symbol's own +g<fill> modifier, the sample vector shown in the auto-legend (-l) is drawn unfilled. This PR fixes this in psxy.c and psxyz.c.

Tested with:

echo "0.5 0.5 45 1.5" | gmt plot -JX5c -R0/1/0/1 -B -lVector -SV0.3c+e+gred -png vector_heads
echo "0.5 0.5 0 45 1.5" | gmt plot3d -JX5c -JZ3c -R0/1/0/1/0/1 -B -p135/30 -lVector3D -SV0.3c+e+gred -png vector_heads_3D

Fixes #9167

Implemented with Claude Sonnet 5 (Claude Code).

When a vector symbol's fill was set via -SV...+g<fill> (rather than via
-G<fill>), gmt_add_legend_item() was only ever passed Ctrl->G.fill, which
stays at its unset sentinel since -G was never given. This caused the
auto-legend entry (-l) to be written with no fill, so the vector head in
the legend rendered unfilled even though the same vector drawn on the map
was correctly filled via S.v.fill.

Fixes #9167
psxyz.c had the identical issue as psxy.c (fixed in the previous commit):
Ctrl->G.fill was never synced with S.v.fill when the vector head fill
came from +g<fill> instead of -G<fill>, so gmt_add_legend_item() wrote
an unfilled vector head into the auto-legend entry.

Related to #9167
@Esteban82 Esteban82 added add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence. labels Aug 29, 2026
@Esteban82
Esteban82 requested a review from a team August 29, 2026 16:49
@Esteban82
Esteban82 marked this pull request as ready for review August 29, 2026 16:49
@Esteban82
Esteban82 requested review from joa-quim and seisman August 29, 2026 16:50
@Esteban82

Copy link
Copy Markdown
Member Author

Could you test this @mkononets?

@mkononets

Copy link
Copy Markdown

No, unfortunately, I cannot promise testing this now or any time soon. Swallowed up by preparations for field measurements for a new project.

@Esteban82
Esteban82 merged commit 4c71cc2 into master Aug 30, 2026
11 of 14 checks passed
@Esteban82
Esteban82 deleted the fix-9167 branch August 30, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gmt plot, unpainted vector head in the auto legend

3 participants