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

Image widget not updating size when new image is loaded #100

Closed
Shootertrex opened this issue Dec 1, 2019 · 1 comment · Fixed by #101
Closed

Image widget not updating size when new image is loaded #100

Shootertrex opened this issue Dec 1, 2019 · 1 comment · Fixed by #101
Labels
bug Something isn't working
Milestone

Comments

@Shootertrex
Copy link
Contributor

When providing a new path for an image, the image widget will load the picture, but the size will stay the same as the previous image until changing the window size as seen below:

Before
2019-12-01_15:31:52_1020x791

After
2019-12-01_15:32:03_1025x792

After digging around a bit, it seems to be an issue with the way the image widget is cached. Simply adding self.path.hash(state) to the hash_layout method like below fixes it.

fn hash_layout(&self, state: &mut Hasher) {
    self.path.hash(state);
    self.width.hash(state);
    self.height.hash(state);
}

Seems like a trivial fix to me, so if it looks good to you, I can throw up a PR.

@hecrj
Copy link
Member

hecrj commented Dec 1, 2019

@Shootertrex Thanks for the report!

Yes, the fix sounds good! Feel free to open a PR with it!

@hecrj hecrj added the bug Something isn't working label Dec 1, 2019
@hecrj hecrj added this to the 0.1.0 milestone Dec 1, 2019
@hecrj hecrj closed this as completed in #101 Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants