Skip to content

Fix the text transparency ramp during the rise phase (-Et+r) for labels#9090

Merged
Esteban82 merged 2 commits into
masterfrom
fix-8328_events-label_transparency
Jul 6, 2026
Merged

Fix the text transparency ramp during the rise phase (-Et+r) for labels#9090
Esteban82 merged 2 commits into
masterfrom
fix-8328_events-label_transparency

Conversation

@Esteban82

Copy link
Copy Markdown
Member

Done by Claude Sonnet 5

Description

The rise-phase transparency was incorrectly computed using PSEVENTS_DECAY instead of PSEVENTS_RISE. Since labels do not have a decay phase, this resulted in a division by zero and generated Inf/NaN transparency values. Consequently, pstext fell back to fully opaque text and issued a warning as described in #8328

Testing

This can be reproduced with:

echo 20 6.5 0 1 Red Label > red.txt
gmt events red.txt -T-0.6 -R-20/40/1/9 -JX20c/10c -Et+r1 -Mt100 -F+f18p+jBC -L -png test

Fixed:

With this fix, the generated frame shows a partially transparent label (~60% transparency).
test_fixed

Without fix:

Without this fix, the label is rendered fully opaque and GMT reports a warning about an invalid transparency value.

test

Fixes #8328

@Esteban82 Esteban82 requested review from a team, joa-quim and seisman July 6, 2026 14:57
@Esteban82 Esteban82 added add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence. labels Jul 6, 2026

@joa-quim joa-quim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems pretty harmless if it woks.

@Esteban82

Copy link
Copy Markdown
Member Author

It is also coherent with the funcion for symbols

	x = psevents_ramp (GMT, Ctrl, PSEVENTS_SYMBOL, PSEVENTS_RISE, t, t_now);	/* Ramp function */

@Esteban82 Esteban82 merged commit e84273c into master Jul 6, 2026
10 of 14 checks passed
@Esteban82 Esteban82 deleted the fix-8328_events-label_transparency branch July 6, 2026 16: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.

Warning messagge with text via gmt events -Et

2 participants