From 77522becf83049917d176175a32eeab86720c537 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Sat, 29 Aug 2026 12:26:05 -0300 Subject: [PATCH 1/2] Fix unfilled vector head in auto-legend when using +g modifier When a vector symbol's fill was set via -SV...+g (rather than via -G), 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 --- src/psxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/psxy.c b/src/psxy.c index 7c97b06be7f..de9a2e513bc 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -1509,7 +1509,7 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { geovector = (S.symbol == GMT_SYMBOL_GEOVECTOR); if ((S.v.status & PSL_VEC_FILL) == 0 && !S.v.parsed_v4) Ctrl->G.active = false; /* Want no fill so override -G */ if (S.v.status & PSL_VEC_FILL2) { /* Gave +g to set head fill; odd, but overrides -G (and sets -G true) */ - current_fill = S.v.fill; /* Override any -G with specified head fill */ + current_fill = Ctrl->G.fill = S.v.fill; /* Override any -G with specified head fill, and let auto-legend see it too */ if (S.v.status & PSL_VEC_FILL) Ctrl->G.active = true; } else if (S.v.status & PSL_VEC_FILL) { From 52f35a66c563484f455ba1bd0a1cdf9dc33d28b6 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Sat, 29 Aug 2026 13:41:44 -0300 Subject: [PATCH 2/2] Fix same unfilled vector-head-in-legend bug in psxyz 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 instead of -G, so gmt_add_legend_item() wrote an unfilled vector head into the auto-legend entry. Related to #9167 --- src/psxyz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/psxyz.c b/src/psxyz.c index 98f61c79110..f791aadf197 100644 --- a/src/psxyz.c +++ b/src/psxyz.c @@ -1047,7 +1047,7 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { if (S.symbol == PSL_VECTOR || S.symbol == GMT_SYMBOL_GEOVECTOR || S.symbol == PSL_MARC ) { /* One of the vector symbols */ geovector = (S.symbol == GMT_SYMBOL_GEOVECTOR); if (S.v.status & PSL_VEC_FILL2) { /* Gave +g to set head fill; odd, but overrides -G (and sets -G true) */ - current_fill = S.v.fill; /* Override any -G with specified head fill */ + current_fill = Ctrl->G.fill = S.v.fill; /* Override any -G with specified head fill, and let auto-legend see it too */ if (S.v.status & PSL_VEC_FILL) Ctrl->G.active = true; } else if (S.v.status & PSL_VEC_FILL) {