Closed Sruimeng closed 3 weeks ago
[!WARNING]
Review failed
The pull request is closed.
The recent update refines the TextItem
and TextLayout
classes, enhancing the vertical offset calculation in the text rendering process. Specifically, the y
offset now considers the number of lines and their height to align more accurately with the editor's behavior. This change aims to improve consistency and visual accuracy in text positioning.
File Path | Change Summary |
---|---|
packages/effects-core/src/plugins/text/text-item.ts |
Modified y offset calculation in TextItem class to account for number of lines and line height. |
packages/effects-core/src/plugins/text/text-layout.ts |
Updated getOffsetY method in TextLayout class to include lineCount and lineHeight for vertical offset calculation. |
sequenceDiagram
participant Editor
participant TextItem
participant TextLayout
Editor->>TextItem: setOffsetY(style, lineCount, lineHeight)
TextItem->>TextLayout: getOffsetY(style, lineCount, lineHeight)
TextLayout-->>TextItem: offsetResult
TextItem-->>Editor: Updated Y Offset
The lines align, they dance with glee,
In perfect height, where text should be.
Y offset tuned, right to the core,
Now editors smile and errors no more.
Each line precise, a coder’s delight,
CodeRabbit hops, making it right! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit