1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:57:44 +00:00

LibSoftGPU: Use lroundf instead of roundf in rasterization rect

Casting a `float` to `int` might still inadvertently floor the value,
while `lroundf` will return a properly rounded `long`.
This commit is contained in:
Jelle Raaijmakers 2022-03-06 19:04:36 +01:00 committed by Andreas Kling
parent 37dd10fbbe
commit 439617cf6f

View file

@ -1316,8 +1316,8 @@ Gfx::IntRect Device::get_rasterization_rect_of_size(Gfx::IntSize size)
// "Any fragments whose centers lie inside of this rectangle (or on its bottom or left
// boundaries) are produced in correspondence with this particular group of elements."
return {
static_cast<int>(roundf(m_raster_position.window_coordinates.x())),
static_cast<int>(roundf(m_raster_position.window_coordinates.y())),
static_cast<int>(lroundf(m_raster_position.window_coordinates.x())),
static_cast<int>(lroundf(m_raster_position.window_coordinates.y())),
size.width(),
size.height(),
};