Simplifying logic in resize_text
There was a bit of redundancy in the code:
- variables
iandsizeare nearly identical - variable
overflowisn't necessary: it starts at false,whileexecutes at least once, it assigns function result to a value then check for falsiness – instead could check function result directly inwhile
I am unsure why size = i - 2 was needed; if i fits then why decrements by 2 pixels?
Great library, could def use it in our team
Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword
link(e.g. "Link T-123").💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.
I think the -2 is needed to still prevent overflowing in some cases:
https://svelte.dev/repl/f510622fc2964815909e5f0ba553088e?version=3.50.0
Here's a link to a svelte repl: if you check or uncheck the checbox above you can swap between the two implementations and you can see commenting the line 31 make the action behave differently from the original package.