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

Non animated icons do not resize #16

Closed
georgelioris opened this issue Mar 28, 2020 · 1 comment
Closed

Non animated icons do not resize #16

georgelioris opened this issue Mar 28, 2020 · 1 comment

Comments

@georgelioris
Copy link
Contributor

Expected Behavior

Changing the size property of the component resizes the icon.

Current Behavior

The icon disappears if animate={false} was specified.

Detailed Description

This behavior only happens on non animated icons.
On animated icons, the draw() function in skycons.js get's called at an interval, and if
resizeClear: true is not specified it will redraw based on canvas size. As a result, animated icons will always resize properly, even though size is not a dependency of the useEffect hook.

Context

This a result of #15 I submitted to refactor the component. Hence, I'm sending another to fix this soon.

Possible Implementation

Adding the size as a dependency is the easiest solution.
Also the class should be instantiated with resizeClear: true since not specifying it now is redundant.

I am aware that this is somewhat sub-optimal but after spending some time implementing a resize method, I believe this is the safest way to go without major refactors.

divyanshu013 pushed a commit that referenced this issue Apr 5, 2020
Fixing #16

    Added size to the dependencies
    Instantiating the class with resizeClear: true
@divyanshu013
Copy link
Owner

Fixed in #17. Thanks for contributing.

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

No branches or pull requests

2 participants