Skip to content

Conversation

@wumaolinmaoan
Copy link
Contributor

@wumaolinmaoan wumaolinmaoan commented Jan 6, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Fixed text outline rendering to only display when an outline width is greater than 0, preventing unnecessary outline drawing and ensuring outline settings are properly respected.

✏️ Tip: You can customize this high-level summary in your review settings.

@wumaolinmaoan wumaolinmaoan requested a review from yiiqii January 6, 2026 08:20
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

Modified the outline rendering condition in the text item plugin to include an explicit check for outline width greater than zero, preventing strokeText operations when outline width is zero or negative.

Changes

Cohort / File(s) Summary
Text Outline Rendering Logic
packages/effects-core/src/plugins/text/text-item.ts
Added width validation to outline rendering condition: changed style.isOutlined to style.isOutlined && style.outlineWidth > 0 to skip drawing outlines with zero or negative width.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

✨ A curious rabbit hops with glee,
For outlines now drawn only when they should be!
No phantom strokes where width is nil,
The rendering sparkles—refined with skill! 🎨🐰

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a condition to prevent outline rendering when outline width is 0, which matches the file modification summary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/effects-core/src/plugins/text/text-item.ts (1)

406-408: Consider adding the width check here for consistency.

For consistency with the fix at line 456 and the pattern at line 510, you could add the outlineWidth > 0 check before calling setupOutline():

-if (style.isOutlined) {
+if (style.isOutlined && style.outlineWidth > 0) {
   this.setupOutline();
 }

This avoids setting up outline parameters when no outline will be drawn.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a466fca and 66109bf.

📒 Files selected for processing (1)
  • packages/effects-core/src/plugins/text/text-item.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-09T08:44:15.153Z
Learnt from: Fryt1
Repo: galacean/effects-runtime PR: 1305
File: packages/effects-core/src/fallback/migration.ts:325-330
Timestamp: 2025-12-09T08:44:15.153Z
Learning: In `packages/effects-core/src/fallback/migration.ts`, the `textColor` 0-255 to 0-1 conversion in `version35Migration` is intentionally applied only to `TextComponent` and not to `RichTextComponent`, as confirmed by Fryt1.

Applied to files:

  • packages/effects-core/src/plugins/text/text-item.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
packages/effects-core/src/plugins/text/text-item.ts (1)

456-456: LGTM! Consistent fix for preventing zero-width outlines.

The added condition correctly prevents strokeText operations when outline width is 0, which aligns with the same pattern used in getEffectPadding() at line 510.

@yiiqii yiiqii merged commit e8984e9 into main Jan 8, 2026
2 checks passed
@yiiqii yiiqii deleted the fix/outline-width-zero-draw branch January 8, 2026 10:51
@coderabbitai coderabbitai bot mentioned this pull request Jan 8, 2026
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.

3 participants