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: ellipsis with maxWidth #542

Merged
merged 1 commit into from
Sep 17, 2023
Merged

fix: ellipsis with maxWidth #542

merged 1 commit into from
Sep 17, 2023

Conversation

LuciNyan
Copy link
Contributor

@LuciNyan LuciNyan commented Sep 14, 2023

Description

This may be a temporary fix, I didn't dig deep into yoga. But when the return value of width here doesn't change (assuming the value of width is 216.9), when we later get the width through parent.getComputedWidth(), sometimes it returns 216 and sometimes 217. I'm not sure if this is a yoga bug, but it seems related to the entire page width.

Closes: #540

Screen.Recording.2023-09-14.at.11.11.07.PM.mov

@vercel
Copy link

vercel bot commented Sep 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
satori-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 14, 2023 3:14pm

Copy link

@orca-security-us orca-security-us bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

Copy link
Member

@shuding shuding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Although I'm not sure what the problem is, but I think this fix makes sense. Since we're transferring float numbers from JS to WASM (Yoga), there must be some data loss in between so this is safer.

@shuding shuding merged commit fcaae1d into vercel:main Sep 17, 2023
9 checks passed
@github-actions
Copy link

🎉 This PR is included in version 0.10.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

sahithyandev pushed a commit to sahithyandev/satori that referenced this pull request Apr 26, 2024
### Description
This may be a temporary fix, I didn't dig deep into yoga. But when the
return value of width here doesn't change (assuming the value of width
is 216.9), when we later get the width through
`parent.getComputedWidth()`, sometimes it returns 216 and sometimes 217.
I'm not sure if this is a yoga bug, but it seems related to the entire
page width.

Closes: vercel#540


https://github.com/vercel/satori/assets/22126563/6929db4c-60e8-4a85-ae8b-497ad64c317e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextOverflow ellipsis maxWidth incorrect
2 participants