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

Eye rotation doesn't work with inherited colors #105

Open
mustanggb opened this issue Mar 14, 2022 · 2 comments
Open

Eye rotation doesn't work with inherited colors #105

mustanggb opened this issue Mar 14, 2022 · 2 comments

Comments

@mustanggb
Copy link
Contributor

In drawEye() rotation will be ignored if inheritsBothColors() inheritsExternalColor() or inheritsInternalColor() return true.

Not sure what the best solution is, open to suggestions.

@DASPRiD
Copy link
Member

DASPRiD commented Mar 14, 2022

Ugh, very good question. To be fair, I've written that code over four years ago, and I'm not even certain anymore what the actual logic in there was supposed to do.

Reading through it a little bit, the general logic was apparently this:

If some element inherits the main color, it is added to the global path object, otherwise it is directly drawn with the given rotation and color through the image back-end.

I guess the correct solution would be to rotate each path when appending it to the module path.

When you write a fix for that, please make sure to cover that new logic with one or more unit test, see:

https://github.com/Bacon/BaconQrCode/tree/master/test/Integration

@mustanggb
Copy link
Contributor Author

I guess the correct solution would be to rotate each path when appending it to the module path.

This was my thought also, unfortunately path doesn't have a rotate function (yet).

My understanding of the codebase isn't able to chuck one in quickly either at the moment.

If I figure it out I'll be sure to let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants