mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +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:
parent
3b75b9ef1c
commit
72e959d753
1 changed files with 12 additions and 4 deletions
|
@ -20,12 +20,20 @@ ErrorOr<BorderRadiusCornerClipper> BorderRadiusCornerClipper::create(PaintContex
|
|||
auto bottom_left = border_radii.bottom_left.as_corner(context);
|
||||
|
||||
DevicePixelSize corners_bitmap_size {
|
||||
max(
|
||||
max(
|
||||
top_left.horizontal_radius + top_right.horizontal_radius,
|
||||
bottom_left.horizontal_radius + bottom_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(
|
||||
max(
|
||||
top_left.vertical_radius + bottom_left.vertical_radius,
|
||||
top_right.vertical_radius + bottom_right.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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue