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

Fix BltPixel::from conversion #135

Merged
merged 1 commit into from
May 28, 2020
Merged

Conversation

BinaryTENSHi
Copy link
Contributor

Small fix in the conversion from a u32 to a BltPixel.

Because the precedence of the shift operator is stronger than the bitwise AND, the masks are shifted before applying, resulting in all channels being set to the blue channel.

Without the additional parenthesis, green: (color & 0x00_FF_00 >> 8) expands to green: (color & 0x00_00_FF) first.

@GabrielMajeri
Copy link
Collaborator

Whoops, that was quite an oversight. Thanks for the fix!

@GabrielMajeri GabrielMajeri merged commit 57c7554 into rust-osdev:master May 28, 2020
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

Successfully merging this pull request may close these issues.

2 participants