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

Incorrect bitshifts #14

Closed
maddyblue opened this issue Aug 24, 2014 · 2 comments
Closed

Incorrect bitshifts #14

maddyblue opened this issue Aug 24, 2014 · 2 comments

Comments

@maddyblue
Copy link

github.com/vdobler/chart/svgg/svg.go:59: suspicious shift of sg.bg.R
github.com/vdobler/chart/svgg/svg.go:59: suspicious shift of sg.bg.G
github.com/vdobler/chart/svgg/svg.go:59: suspicious shift of sg.bg.B
github.com/vdobler/chart/svgg/svg.go:60: suspicious shift of sg.bg.A
github.com/vdobler/chart/svgg/svg.go:73: suspicious shift of sg.bg.R
github.com/vdobler/chart/svgg/svg.go:73: suspicious shift of sg.bg.G
github.com/vdobler/chart/svgg/svg.go:73: suspicious shift of sg.bg.B
github.com/vdobler/chart/svgg/svg.go:73: suspicious shift of sg.bg.A

The above locations shift color.RGBA fields right by 8 (c.R >> 8). But as they are uint8s, a right shift of 8 will always yield 0. It's not obvious what these shifts are supposed to be doing.

@vdobler
Copy link
Owner

vdobler commented Aug 27, 2014

You are right. Maybe these shifts are a relict from Color's interface RGBA method which produces uint16s.

@maddyblue
Copy link
Author

fixed by e4082bd

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