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

Name bg rectangles are not the correct width #16

Open
dsernst opened this issue Sep 19, 2016 · 3 comments
Open

Name bg rectangles are not the correct width #16

dsernst opened this issue Sep 19, 2016 · 3 comments
Labels

Comments

@dsernst
Copy link
Member

dsernst commented Sep 19, 2016

The translucent white rectangles shown behind voter names are only approximately the correct width. But some of them are too wide and sometimes too narrow. It looks a bit buggy.

Too long:
too long

Too short:
too short

@dsernst
Copy link
Member Author

dsernst commented Sep 19, 2016

This is because the width of the background rectangles is set by string.length * 5 pixels, but not all letters are the same width (iii vs www).

@dsernst
Copy link
Member Author

dsernst commented Sep 19, 2016

Last night I tried to fix this with a monospace font (Lucida Console), but it did not look good, and didn't really work anyway. Perhaps a better monospace font could work, but browser compatibility is something to keep in mind.

@dsernst
Copy link
Member Author

dsernst commented Sep 19, 2016

A better fix would be to properly grab the text's bounding box to use for width: http://stackoverflow.com/questions/32026194/how-to-add-a-background-color-to-d3-text-elements

@dsernst dsernst added the bug label Sep 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant