Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: layout wrapping space #856

Merged
merged 2 commits into from
Nov 10, 2021
Merged

Conversation

temper357
Copy link
Contributor

Closes #745

修复当文本容器 display 为 inline-block,且容器宽度超出 parent 时文本 layout 时 constraints 为负值报错。

  • fix: 对于无宽度且 display 为 inline-block 的容器,其 children 的换行规则为计算 inline-block 容器相对于其 ancestor 的剩余空间,当 inline-block 容器有 padding/border 时,剩余空间可能为负值,这种情况下需要作异常处理。另外对于文本来说,浏览器的处理是按照 break-word 作处理,但是 Flutter 的文本排版引擎在剩余空间小于文本自身宽度的 case 下是作 break-all 的处理,且 Flutter 无法指定 break-all 规则,为了尽可能接近浏览器表现,Kraken 在剩余空间为负值情况下对文本选择作不换行处理。

@cnryb
Copy link
Member

cnryb commented Nov 8, 2021

使用这个 PR 的代码, #745 可以正常渲染

@andycall andycall merged commit bfaff2f into feat-css-style-sheet Nov 10, 2021
@andycall andycall deleted the fix/wrapping-space branch November 10, 2021 07:14
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.

None yet

4 participants