Skip to content

Fix inline width after backtracked line breaks - #2803

Merged
liZe merged 2 commits into
Kozea:mainfrom
Greunlis:main
Jul 12, 2026
Merged

liZe merged 2 commits into
Kozea:mainfrom
Greunlis:main

Conversation

@Greunlis

@Greunlis Greunlis commented Jun 18, 2026 •

Copy link
Copy Markdown

Recompute split inline box width from retained children instead of using a stale cursor position. This avoids phantom trailing width when later inline content is moved to the next line.

Before:
test.pdf
After:
test.pdf

Co-authored-by: ChatGPT noreply@openai.com

Jakub Holotík and others added 2 commits June 18, 2026 13:31
Recompute split inline box width from retained children instead of using a stale cursor position. This avoids phantom trailing width when later inline content is moved to the next line.

Add a regression test for right-aligned nested inline content.

Co-authored-by: ChatGPT <noreply@openai.com>
@liZe

liZe commented Jul 12, 2026

Copy link
Copy Markdown
Member

Hi!

Thanks for the pull request.

I don’t like to change the line breaking algorithm, but here we remove a hack and use the same, correct way to set the line height, so… Let’s merge, and hope that we won’t introduce a regression!

Co-authored-by: ChatGPT

Please 🙏 carefully read AI pull requests in the future, the code duplication is obvious and masks the fact that this code is actually a possible simplification… when we use a brain to think about that. The time contributors don’t spend is time spent by maintainers, and that doesn’t scale well. In case you don’t want to spend this time, an issue is often better than a pull request: maintainers know how to use AI to write code if they want to, and if they prefer to write code they definitely don’t want to spend time fixing ChatGPT’s code.

(And thanks for the short comment, not the useless walls of text AI usually generates!)

@liZe
liZe merged commit b997792 into Kozea:main Jul 12, 2026
8 checks passed
@liZe liZe added the bug Existing features not working as expected label Jul 12, 2026
@liZe liZe added this to the 70.0 milestone Jul 12, 2026
@Greunlis

Copy link
Copy Markdown
Author

Thanks for the fix!

I saw the duplication, but din't have enough code understanding to responsibly refactor it. Good point, sometimes it might be better to make an issue, I'll think about it the next time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Existing features not working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants