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

QrCode's Index trait is indexing (col, row) instead of (row, col) #26

Open
adityapk00 opened this issue Jun 14, 2019 · 0 comments
Open

Comments

@adityapk00
Copy link

The Index<> for QrCode implementation here seems to have interchanged the row and column, indexing into the array the wrong way.

The other functions (like to_colors()) is returning row-major order, while the Index is the only one returning column-major.

The current code is:

let index = y * self.width + x;

It should probably be

let index = x * self.width + y;
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

1 participant