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

use binary searching algorithm if max font value set #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RMaksymczuk
Copy link

Hey,

We have this project in which we're using infinity scrolling with your boxfit plugin. I noticed that for a large number of components which are using this solution, it is noticeably for a user that text is blinking. I also noticed that for searching proper font size, for each element, I need to make ~25 loop steps. So the idea was to use some searching algorithm to reduce number of steps and comparisons. For that I used the binary searching algorithm, whereby the number of steps decreased to ~3. The only requirement is to have both, minimum and maximum font size set.

In pull request I depend my algorithm to settings.maximum_font_size, so it will run only for user who have set that value and for another situations, the old algorithm will be used. If you like my solution, I think we can go on. Maybe there is a possibility to set some default number for maximum_font_size, so it can always use binary algorithm.

Would be nice to know your opinion,

Greetings,
Rafal

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