Skip to content

fix(text): improve overflow fit behavior#1157

Open
utkarshhxd wants to merge 1 commit into
ecomfe:masterfrom
utkarshhxd:feat-text-overflow-fit
Open

fix(text): improve overflow fit behavior#1157
utkarshhxd wants to merge 1 commit into
ecomfe:masterfrom
utkarshhxd:feat-text-overflow-fit

Conversation

@utkarshhxd
Copy link
Copy Markdown

@utkarshhxd utkarshhxd commented May 17, 2026

Summary

Add support for overflow: 'fit' text behavior in ZRender.

This change implements horizontal text scaling to fit constrained widths and adds visual test coverage for:

  • normal fit overflow scaling
  • zero-width edge cases

Changes

  • Added overflow: 'fit' scaling behavior for plain text
  • Handled edge cases when width is zero
  • Added visual test cases in test/text.html

Testing

Verified visually through test/text.html:

  • text scales correctly within constrained width
  • zero-width case does not crash or produce invalid rendering
  • no console errors observed

Related to apache/echarts#21607.

This PR implements the underlying text scaling behavior in ZRender required for supporting overflow: 'fit'.

@utkarshhxd utkarshhxd force-pushed the feat-text-overflow-fit branch from 29e4c94 to 613b5dc Compare May 17, 2026 13:13
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.

1 participant