Skip to content

Add TextEffect compositing#495

Merged
RandyGaul merged 4 commits intoRandyGaul:masterfrom
waldnercharles:cute_draw/composite-text-effects
Mar 20, 2026
Merged

Add TextEffect compositing#495
RandyGaul merged 4 commits intoRandyGaul:masterfrom
waldnercharles:cute_draw/composite-text-effects

Conversation

@waldnercharles
Copy link
Copy Markdown
Contributor

@waldnercharles waldnercharles commented Mar 11, 2026

Text Effect Rendering

  • The strike-through effect (<strike>) now uses a per-glyph approach, storing the thickness and deferring the actual line drawing until after all effects and color changes are applied. This ensures the strike line matches the final rendered color and position, including gradients and alpha.
  • The CF_Strike struct now includes a color field, allowing strike-through lines to use the correct color, including gradients.
  • The code for spawning text effects can now handle multiple effects at the same character index.

Fixes #480

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4549552de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

if (render || markups) {
if (!effect_state->alive) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't understand.

Is this included so that the elapsed time is only ticked once per frame?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's exactly right. Without it, an effect's elapsed time was being incremented multiple times per frame. I can't remember if this was because of the while loop I introduced to support compositing effects, or if it happened after I ran multiple effects with the same text_id via cf_draw_push_text_id

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If we're looking for something more explicit I could introduce another bool, but, this one seemed to have the same lifetime semantics that I needed.

@RandyGaul RandyGaul merged commit 440bd58 into RandyGaul:master Mar 20, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

text effect composition bug

3 participants