Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

FIX: dy added twice for right coords #123

Closed
waygood opened this issue Apr 29, 2014 · 1 comment
Closed

FIX: dy added twice for right coords #123

waygood opened this issue Apr 29, 2014 · 1 comment

Comments

@waygood
Copy link

waygood commented Apr 29, 2014

Hi,
This is for the website version, not the github version, which is correct.
I've been looking through this, which is fantastic for what I need.
When testing, the guage goes all wonky if your browser is much taller than wider (Y padding only)

The solution is to change the Yo and Yi formulae
OLD:
Xo = w / 2 + dx + Ro * Math.cos(alpha),
Yo = h - (h - Cy) + dy - Ro * Math.sin(alpha),
Xi = w / 2 + dx + Ri * Math.cos(alpha),
Yi = h - (h - Cy) + dy - Ri * Math.sin(alpha),

NEW:
Xo = w / 2 + dx + Ro * Math.cos(alpha),
Yo = h - (h - Cy) - Ro * Math.sin(alpha),
Xi = w / 2 + dx + Ri * Math.cos(alpha),
Yi = h - (h - Cy) - Ri * Math.sin(alpha),

The reason is that Cy already has dy added to it ( Cy = h / 1.25 + dy )

@toorshia
Copy link
Owner

#245

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants