diff --git a/Userland/Libraries/LibGfx/Bitmap.cpp b/Userland/Libraries/LibGfx/Bitmap.cpp index 00dad64630..7a2e3df1a4 100644 --- a/Userland/Libraries/LibGfx/Bitmap.cpp +++ b/Userland/Libraries/LibGfx/Bitmap.cpp @@ -427,7 +427,10 @@ RefPtr Bitmap::scaled(float sx, float sy) const if (floorf(sx) == sx && floorf(sy) == sy) return scaled(static_cast(sx), static_cast(sy)); - auto new_bitmap = Gfx::Bitmap::create(format(), { width() * sx, height() * sy }, scale()); + int scaled_width = (int)ceilf(sx * (float)width()); + int scaled_height = (int)ceilf(sy * (float)height()); + + auto new_bitmap = Gfx::Bitmap::create(format(), { scaled_width, scaled_height }, scale()); if (!new_bitmap) return nullptr;