1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:07:34 +00:00

LibWeb: Fix calculation of bitmap size in BorderRadiusCornerClipper

Correctly compute the maximum possible width and height for
corners_bitmap_size by considering all pair combinations of corners.

Partially fixes issue https://github.com/SerenityOS/serenity/issues/20205
This commit is contained in:
Aliaksandr Kalenik 2023-07-27 03:57:27 +02:00 committed by Andreas Kling
parent 3b75b9ef1c
commit 72e959d753

View file

@ -21,11 +21,19 @@ ErrorOr<BorderRadiusCornerClipper> BorderRadiusCornerClipper::create(PaintContex
DevicePixelSize corners_bitmap_size {
max(
top_left.horizontal_radius + top_right.horizontal_radius,
bottom_left.horizontal_radius + bottom_right.horizontal_radius),
max(
top_left.horizontal_radius + top_right.horizontal_radius,
top_left.horizontal_radius + bottom_right.horizontal_radius),
max(
bottom_left.horizontal_radius + top_right.horizontal_radius,
bottom_left.horizontal_radius + bottom_right.horizontal_radius)),
max(
top_left.vertical_radius + bottom_left.vertical_radius,
top_right.vertical_radius + bottom_right.vertical_radius)
max(
top_left.vertical_radius + bottom_left.vertical_radius,
top_left.vertical_radius + bottom_right.vertical_radius),
max(
top_right.vertical_radius + bottom_left.vertical_radius,
top_right.vertical_radius + bottom_right.vertical_radius))
};
RefPtr<Gfx::Bitmap> corner_bitmap;