1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

Userland: Fix 64-bit portability issues

This commit is contained in:
Gunnar Beutner 2021-05-02 00:00:52 +02:00 committed by Andreas Kling
parent fdbe66a7b4
commit b613817bca
15 changed files with 59 additions and 30 deletions

View file

@ -360,13 +360,13 @@ void ChessWidget::set_piece_set(const StringView& set)
Chess::Square ChessWidget::mouse_to_square(GUI::MouseEvent& event) const
{
size_t tile_width = width() / 8;
size_t tile_height = height() / 8;
unsigned tile_width = width() / 8;
unsigned tile_height = height() / 8;
if (side() == Chess::Color::White) {
return { 7 - (event.y() / tile_height), event.x() / tile_width };
return { (unsigned)(7 - (event.y() / tile_height)), (unsigned)(event.x() / tile_width) };
} else {
return { event.y() / tile_height, 7 - (event.x() / tile_width) };
return { (unsigned)(event.y() / tile_height), (unsigned)(7 - (event.x() / tile_width)) };
}
}