Skip to content

Merge origin/main into origin/feat/2.9#1397

Merged
yiiqii merged 13 commits intofeat/2.9from
main
Feb 6, 2026
Merged

Merge origin/main into origin/feat/2.9#1397
yiiqii merged 13 commits intofeat/2.9from
main

Conversation

@yiiqii
Copy link
Collaborator

@yiiqii yiiqii commented Feb 4, 2026

Summary by CodeRabbit

Release Notes - Version 2.8.8

  • Bug Fixes

    • Fixed letter spacing calculation in text components to correctly skip the first character in each line.
    • Corrected shadow color setting in text component rendering.
    • Improved floating-point precision handling in Bernstein mathematical function.
    • Fixed wrap width calculation in rich text rendering.
  • Documentation

    • Added deprecation notice recommending maxTextWidth and maxTextHeight over the setSize method.

@yiiqii yiiqii requested a review from wumaolinmaoan February 4, 2026 10:16
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

This release bumps the version from 2.8.7 to 2.8.8 across all packages and includes four bug fixes: per-line letter spacing in text component, shadow color reading from textStyle, removal of scaleFactor parameter from wrap strategies, and rich text initialization refactoring.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md, CHANGELOG-zh_CN.md
Added version 2.8.8 changelog entries dated 2026-02-04 with four bugfix notes.
Package Version Bumps
packages/effects-core/package.json, packages/effects-helper/package.json, packages/effects-threejs/package.json, packages/effects-webgl/package.json, packages/effects/package.json, plugin-packages/alipay-downgrade/package.json, plugin-packages/downgrade/package.json, plugin-packages/editor-gizmo/package.json, plugin-packages/ffd/package.json, plugin-packages/ktx2/package.json, plugin-packages/model/package.json, plugin-packages/multimedia/package.json, plugin-packages/orientation-transformer/package.json, plugin-packages/rich-text/package.json, plugin-packages/spine/package.json, plugin-packages/stats/package.json
Bumped all package versions from 2.8.7 to 2.8.8.
Text Component Fixes
packages/effects-core/src/plugins/text/text-component-base.ts, packages/effects-core/src/plugins/text/text-item.ts
Fixed shadow color to read from textStyle instead of outlineColor; introduced per-line character counting to conditionally apply letter spacing (skipping first character per line) for accurate width calculations.
Rich Text Refactoring
plugin-packages/rich-text/src/rich-text-component.ts, plugin-packages/rich-text/src/rich-text-layout.ts, plugin-packages/rich-text/src/strategies/rich-text-interfaces.ts, plugin-packages/rich-text/src/strategies/wrap/rich-wrap-disabled.ts, plugin-packages/rich-text/src/strategies/wrap/rich-wrap-enabled.ts
Removed scaleFactor parameter from computeLines signature; introduced local fixed scaleFactor (1/10) in wrap strategies; replaced renderText() with updateTexture() call in initialization; added deprecation note to setSize method.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • wumaolinmaoan
  • Sruimeng

Poem

🐰 From seven-point-eight to eight so keen,
Letters spacing, shadows seen,
Wrap strategies scaled anew,
Rich text flows in version's view,
A hoppy bump, our fixes bloom!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes a branch merge operation rather than the substantive changes (version bump to 2.8.8 with bug fixes in text and rich-text components). Use a descriptive title summarizing the actual changes, such as 'Bump version to 2.8.8 with text component and rich-text layout fixes' instead of the generic merge message.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch main

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/effects-core/src/plugins/text/text-item.ts (1)

216-252: ⚠️ Potential issue | 🟡 Minor

Avoid adding letter spacing before wrap/newline decisions.
Spacing is currently applied before wrap/newline checks, which can add a trailing space to the previous line’s width and slightly skew alignment. Consider applying spacing only when the character is actually placed on the current line.

🧩 Suggested adjustment
-      // 和浏览器行为保持一致
-      // 字符间距只应用在字符之间,每行第一个字符不加间距
-      if (charCountInLine > 0) {
-        x += letterSpace;
-      }
+      const isNewLine = str === '\n';
+      let spacing = charCountInLine > 0 ? letterSpace : 0;
       // 处理文本结束行为
       if (overflow === spec.TextOverflow.display) {
-        if (str === '\n') {
+        if (isNewLine) {
           lineCount++;
           x = 0;
           charCountInLine = 0;
         } else {
-          x += textMetrics;
+          x += spacing + textMetrics;
           charCountInLine++;
           this.maxLineWidth = Math.max(this.maxLineWidth, x);
         }
       } else {
-        if (((x + textMetrics) > width && i > 0) || str === '\n') {
+        if (((x + spacing + textMetrics) > width && i > 0) || isNewLine) {
           lineCount++;
           this.maxLineWidth = Math.max(this.maxLineWidth, x);
           x = 0;
           charCountInLine = 0;
+          spacing = 0;
         }
-        if (str !== '\n') {
-          x += textMetrics;
+        if (!isNewLine) {
+          x += spacing + textMetrics;
           charCountInLine++;
         }
       }
-        // 和浏览器行为保持一致
-        // 字符间距只应用在字符之间,每行第一个字符不加间距
-        if (charsArray.length > 0) {
-          x += layout.letterSpace * fontScale;
-        }
-
-        if (((x + textMetrics.width) > baseWidth && i > 0) || str === '\n') {
+        const isNewLine = str === '\n';
+        let spacing = charsArray.length > 0 ? layout.letterSpace * fontScale : 0;
+        if (((x + spacing + textMetrics.width) > baseWidth && i > 0) || isNewLine) {
           charsInfo.push({
             y,
             width: x,
             chars: charsArray,
             charOffsetX,
           });
           x = 0;
           y += lineHeight;
           charsArray = [];
           charOffsetX = [];
+          spacing = 0;
         }
 
-        if (str !== '\n') {
+        if (!isNewLine) {
+          if (spacing > 0) {
+            x += spacing;
+          }
           charsArray.push(str);
           charOffsetX.push(x);
           x += textMetrics.width;
         }

Also applies to: 433-456

@yiiqii yiiqii merged commit e04d67a into feat/2.9 Feb 6, 2026
4 of 5 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.

3 participants