Skip to content

Fix psrose canvas fill (-B+g) being drawn max_radius times too small - #9146

Merged
Esteban82 merged 1 commit into
masterfrom
fix-psrose-canvas-fill
Aug 25, 2026
Merged

Fix psrose canvas fill (-B+g) being drawn max_radius times too small#9146
Esteban82 merged 1 commit into
masterfrom
fix-psrose-canvas-fill

Conversation

@Esteban82

Copy link
Copy Markdown
Member

Diagnosed and patched with Claude Code (Claude Opus 5).

Bug

The do_fill block sized the canvas-fill circle as 2 * Ctrl->S.scale, but a few lines earlier Ctrl->S.scale was divided by max_radius, so it is no longer the plot radius in inches but inches per data unit. With -B+g<fill> and any -R0/<rmax>/... where rmax != 1 the fill circle came out max_radius times too small and was hidden behind the rose.

Use the local variable diameter, which is set before that division and is what the frame-drawing block at the end of the module already uses. The half-circle clip rectangle in the same block had the same defect and is fixed too.

Tested with this script

gmt begin psrose_fill png
	gmt rose @fractures_06.txt -: -R0/20000/0/360 -JX5c -A20 -Gred -B+glightblue
gmt end

Without the fix the lightblue background is not visible at all.

psrose_fill

The do_fill block sized the canvas-fill circle as 2 * Ctrl->S.scale, but a
few lines earlier Ctrl->S.scale was divided by max_radius, so it is no
longer the plot radius in inches but inches per data unit. With -B+g<fill>
and any -R0/<rmax>/... where rmax != 1 the fill circle came out max_radius
times too small and was hidden behind the rose.

Use the local variable diameter, which is set before that division and is
what the frame-drawing block at the end of the module already uses. The
half-circle clip rectangle in the same block had the same defect and is
fixed too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Esteban82
Esteban82 requested review from joa-quim and seisman August 25, 2026 15:47
@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 25, 2026
@Esteban82
Esteban82 merged commit bc391bd into master Aug 25, 2026
11 of 13 checks passed
@Esteban82
Esteban82 deleted the fix-psrose-canvas-fill branch August 25, 2026 18:16
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.

2 participants