mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +00:00
LibWeb: Fix calculation of bitmap size in paint_outer_box_shadow
Correctly compute the maximum possible width and height for shadow_bitmap_rect by considering all pair combinations of corners. Fixes https://github.com/SerenityOS/serenity/issues/20205
This commit is contained in:
parent
72e959d753
commit
9a90bf7d12
|
@ -172,13 +172,17 @@ static void paint_outer_box_shadow(PaintContext& context, CSSPixelRect const& co
|
|||
|
||||
auto shadow_bitmap_rect = DevicePixelRect(
|
||||
0, 0,
|
||||
max(
|
||||
top_left_corner_size.width() + top_right_corner_size.width(),
|
||||
bottom_left_corner_size.width() + bottom_right_corner_size.width())
|
||||
max(max(
|
||||
top_left_corner_size.width() + top_right_corner_size.width(),
|
||||
bottom_left_corner_size.width() + bottom_right_corner_size.width()),
|
||||
max(top_left_corner_size.width() + bottom_right_corner_size.width(),
|
||||
bottom_left_corner_size.width() + top_right_corner_size.width()))
|
||||
+ 1 + blurred_edge_thickness,
|
||||
max(
|
||||
top_left_corner_size.height() + bottom_left_corner_size.height(),
|
||||
top_right_corner_size.height() + bottom_right_corner_size.height())
|
||||
max(max(
|
||||
top_left_corner_size.height() + bottom_left_corner_size.height(),
|
||||
top_right_corner_size.height() + bottom_right_corner_size.height()),
|
||||
max(top_left_corner_size.height() + bottom_right_corner_size.height(),
|
||||
bottom_left_corner_size.height() + top_right_corner_size.height()))
|
||||
+ 1 + blurred_edge_thickness);
|
||||
|
||||
auto top_left_corner_rect = DevicePixelRect {
|
||||
|
|
Loading…
Reference in a new issue