From 46628d0751d6007980df7cdd0a0a394ea6d68255 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 24 Jun 2026 22:49:55 +0800 Subject: [PATCH] plot: Fix the bug that -M+r modifier doesn't set the pen thickness --- src/psxy.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/psxy.c b/src/psxy.c index ce4043b65db..24f771c3ecb 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -1046,9 +1046,11 @@ static int parse (struct GMT_CTRL *GMT, struct PSXY_CTRL *Ctrl, struct GMT_OPTIO Ctrl->M.do_draw = true; break; case 'r': - if (p[1] && gmt_getpen (GMT, &p[1], &Ctrl->M.xpen)) { - gmt_pen_syntax (GMT, 'M', NULL, "Option -M: The +r modifier sets pen attributes for the legend rgb exchange", NULL, 0); - n_errors++; + if (p[1]) { + if (gmt_getpen (GMT, &p[1], &Ctrl->M.xpen)) { + gmt_pen_syntax (GMT, 'M', NULL, "Option -M: The +r modifier sets pen attributes for the legend rgb exchange", NULL, 0); + n_errors++; + } } else /* Guesswork */ Ctrl->M.xpen.width = 2.5; /* Default pen width in points */