mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:37:35 +00:00
LibGfx: Avoid some unnecessary Rounding in AffineTransform and Color
Casts suffice in these cases. (Assuming standard rounding mode)
This commit is contained in:
parent
65f57efb5b
commit
5fd49b9d9f
2 changed files with 7 additions and 7 deletions
|
@ -158,7 +158,7 @@ IntPoint AffineTransform::map(IntPoint const& point) const
|
|||
float mapped_x;
|
||||
float mapped_y;
|
||||
map(static_cast<float>(point.x()), static_cast<float>(point.y()), mapped_x, mapped_y);
|
||||
return { roundf(mapped_x), roundf(mapped_y) };
|
||||
return { round_to<int>(mapped_x), round_to<int>(mapped_y) };
|
||||
}
|
||||
|
||||
template<>
|
||||
|
@ -174,8 +174,8 @@ template<>
|
|||
IntSize AffineTransform::map(IntSize const& size) const
|
||||
{
|
||||
return {
|
||||
roundf(static_cast<float>(size.width()) * x_scale()),
|
||||
roundf(static_cast<float>(size.height()) * y_scale()),
|
||||
round_to<int>(static_cast<float>(size.width()) * x_scale()),
|
||||
round_to<int>(static_cast<float>(size.height()) * y_scale()),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue