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

pre-render full text box #62

Open
tomryanx opened this issue Feb 5, 2023 · 1 comment
Open

pre-render full text box #62

tomryanx opened this issue Feb 5, 2023 · 1 comment

Comments

@tomryanx
Copy link

tomryanx commented Feb 5, 2023

Hi, is there a way to set the box size ahead of time, based on the full text? I'm struggling with lower elements on my page jumping around when the windup does a newline.

@sgwilym
Copy link
Owner

sgwilym commented Feb 7, 2023

windups does not provide anything to help you do this, sorry! And I don't know if it's possible either. The line breaking functionality is provided by using CanvasRenderingContext2D.measureText(), but the measurements it returns do not include a height.

The way I've dealt with this is to make the window follow the last line of text. Either that or you use a fixed height and plan your text accordingly.

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

No branches or pull requests

2 participants