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

DonutProgress draw arc wrongly. #14

Closed
taoliuh opened this issue Feb 27, 2015 · 2 comments
Closed

DonutProgress draw arc wrongly. #14

taoliuh opened this issue Feb 27, 2015 · 2 comments

Comments

@taoliuh
Copy link
Contributor

taoliuh commented Feb 27, 2015

screenshot_2015-02-27-13-57-24
As the image above ,

     if (finishedStrokeWidth > unfinishedStrokeWidth) {
            finishedOuterRect.set(finishedStrokeWidth / 2,
                finishedStrokeWidth / 2,
                getWidth() - finishedStrokeWidth / 2,
                getHeight() - finishedStrokeWidth / 2);
            float delta = (finishedStrokeWidth - unfinishedStrokeWidth) / 2f;
            unfinishedOuterRect.set(unfinishedStrokeWidth / 2,
                unfinishedStrokeWidth / 2,
                getWidth() - unfinishedStrokeWidth / 2 - delta,
                getHeight() - unfinishedStrokeWidth / 2 - delta);
        } else {
            float delta = (unfinishedStrokeWidth - finishedStrokeWidth) / 2f;
            finishedOuterRect.set(finishedStrokeWidth / 2,
                finishedStrokeWidth / 2,
                getWidth() - finishedStrokeWidth / 2 - delta,
                getHeight() - finishedStrokeWidth / 2 - delta);
            unfinishedOuterRect.set(unfinishedStrokeWidth / 2,
                unfinishedStrokeWidth / 2,
                getWidth() - unfinishedStrokeWidth / 2,
                getHeight() - unfinishedStrokeWidth / 2);
        }

I modified so it would like this:
    float delta = Math.max(finishedStrokeWidth, unfinishedStrokeWidth);
    finishedOuterRect.set(delta,
            delta,
            getWidth() - delta,
            getHeight() - delta);
    unfinishedOuterRect.set(delta,
            delta,
            getWidth() - delta,
            getHeight() - delta);

screenshot_2015-02-27-14-06-14

the problem resolved, and I commited a PR.

@lzyzsd
Copy link
Owner

lzyzsd commented Feb 27, 2015

thanks, but I did not receive your PR, do you forget it?

@taoliuh
Copy link
Contributor Author

taoliuh commented Feb 27, 2015

Yeah, I pushed just now.

@taoliuh taoliuh closed this as completed Feb 27, 2015
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