Skip to content

Conversation

@hovi
Copy link

@hovi hovi commented May 16, 2018

I tried to use this library, but I kept having these strange things happening - sometimes at specific width/height of my browser using Chrome, I always had textFit finishing with minimum font size although there was a lot of space.
After debugging I found out, that scrollWidth and originalWidth (or with height) was 1 and it never matched the condition. I am pretty sure this was caused by rounding error either in browser itself or somewhere in your code (I suspect it's chrome issue), because I am using different units (%, em).

Once I changed condition to accept 1 px difference, code works fine in Chrome too, but it also changes behaviour as it may detect something sooner/later, etc.

This is probably not ideal fix, but it works for me well. Not expect this to be merged, but to discuss this.

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.

1 participant