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

Wrong size when using CachedNetworkImage #32

Closed
rubenaster opened this issue May 11, 2021 · 2 comments
Closed

Wrong size when using CachedNetworkImage #32

rubenaster opened this issue May 11, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@rubenaster
Copy link

Hey,

I'm using Scratcher with CachedNetworkImage and the issue I have is that on the first call of OnDraw after the image is loaded I get a size of (10, 10). Quickly afterwards OnDraw is called again with the correct size.

The problem is that the first call of OnDraw already initializes the points lists.

Now my current workaround is to check in OnDraw if the size has changed and if so I re-initialize the points. Of course this might lead to issues.

It works for now since the OnDraw calls appear quickly one ofter the other but maybe you have a better idea?

@vintage vintage added the bug Something isn't working label May 18, 2021
@vintage
Copy link
Owner

vintage commented May 18, 2021

Potential solution to this would be recalculating the scratcher progress when the size of canvas changes. Probably somewhere here https://github.com/vintage/scratcher/blob/master/lib/widgets.dart#L140 a test against constraints could be added to solve the problem.

Well, it would also solve the #30 as that's the same thing.

vintage added a commit that referenced this issue May 18, 2021
@vintage
Copy link
Owner

vintage commented May 18, 2021

Fixed in 2.1.0 https://pub.dev/packages/scratcher

@vintage vintage closed this as completed May 18, 2021
@vintage vintage self-assigned this May 18, 2021
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

No branches or pull requests

2 participants