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

Drawing.bBox measures multi-line text incorrectly #973

Closed
rreusser opened this issue Sep 22, 2016 · 2 comments
Closed

Drawing.bBox measures multi-line text incorrectly #973

rreusser opened this issue Sep 22, 2016 · 2 comments
Labels
bug something broken

Comments

@rreusser
Copy link
Contributor

rreusser commented Sep 22, 2016

If text has <br>, it gets tspans and wraps onto multiple lines. If you pass the text node to Drawing.bBox though, it is measured as if the text is all on one line, giving the incorrect bBox.

In the example below, the text node is passed to Drawing.bBox. The 304 returned as the width is the sum of the widths of each tspan. When it's rendered in updatemenus though, each tspan is on a separate line.

2016-09-22 17 17 21

@rreusser rreusser added the bug something broken label Sep 22, 2016
@etpinard
Copy link
Contributor

This one should be resolved in @alexcjohnson 's #1792

@alexcjohnson
Copy link
Collaborator

Ah good catch @etpinard - yes, fix is included in #1792 (specifically https://github.com/plotly/plotly.js/pull/1792/files#diff-5d20f0f113b3fa06526a5ae593b7de34R640)- and we have tests that were previously testing the incorrect behavior and are now testing the correct behavior, such as 3b293ac 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

3 participants