Skip to content

pstext -D[j|J] is broken#8916

Merged
joa-quim merged 1 commit intoGenericMappingTools:masterfrom
Chuan1937:pstext
Mar 9, 2026
Merged

pstext -D[j|J] is broken#8916
joa-quim merged 1 commit intoGenericMappingTools:masterfrom
Chuan1937:pstext

Conversation

@Chuan1937
Copy link
Member

@Chuan1937 Chuan1937 commented Mar 9, 2026

For MC (Middle Center) alignment, the just value is 6. When calculating the offset in gmt_smart_justify:

xx = (2 - (just % 4)) * dx = 0
yy = (1 - (just / 4)) * dy = 0

So when text is centered horizontally or vertically, the offset in the corresponding direction becomes 0, rendering the -Dj option ineffective.

Solution: When text is centered in a given direction, use the default offset direction (+1) instead of 0:

Fixes #8712

@Chuan1937 Chuan1937 added this to the 6.7.0 milestone Mar 9, 2026
@Chuan1937 Chuan1937 added the bug Something isn't working label Mar 9, 2026
@Chuan1937 Chuan1937 self-assigned this Mar 9, 2026
Copy link
Member

@joa-quim joa-quim left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this.

@joa-quim joa-quim merged commit cbd2796 into GenericMappingTools:master Mar 9, 2026
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pstext -D[j|J] is broken

2 participants