Skip to content

Commit

Permalink
Merge pull request #79350 from kleonc/screen_to_pixel_byte_to_float_c…
Browse files Browse the repository at this point in the history
…onversion_fix

Fix byte to float color conversion in `DisplayServerWindows::screen_get_pixel`
  • Loading branch information
YuriSizov committed Jul 21, 2023
2 parents 5ae6176 + 9d45dd8 commit 88c1e0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platform/windows/display_server_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ Color DisplayServerWindows::screen_get_pixel(const Point2i &p_position) const {
COLORREF col = GetPixel(dc, p.x, p.y);
if (col != CLR_INVALID) {
ReleaseDC(NULL, dc);
return Color(float(col & 0x000000FF) / 256.0, float((col & 0x0000FF00) >> 8) / 256.0, float((col & 0x00FF0000) >> 16) / 256.0, 1.0);
return Color(float(col & 0x000000FF) / 255.0f, float((col & 0x0000FF00) >> 8) / 255.0f, float((col & 0x00FF0000) >> 16) / 255.0f, 1.0f);
}
ReleaseDC(NULL, dc);
}
Expand Down

0 comments on commit 88c1e0d

Please sign in to comment.