mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +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
1 changed files with 10 additions and 6 deletions
|
@ -172,13 +172,17 @@ static void paint_outer_box_shadow(PaintContext& context, CSSPixelRect const& co
|
||||||
|
|
||||||
auto shadow_bitmap_rect = DevicePixelRect(
|
auto shadow_bitmap_rect = DevicePixelRect(
|
||||||
0, 0,
|
0, 0,
|
||||||
max(
|
max(max(
|
||||||
top_left_corner_size.width() + top_right_corner_size.width(),
|
top_left_corner_size.width() + top_right_corner_size.width(),
|
||||||
bottom_left_corner_size.width() + bottom_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,
|
+ 1 + blurred_edge_thickness,
|
||||||
max(
|
max(max(
|
||||||
top_left_corner_size.height() + bottom_left_corner_size.height(),
|
top_left_corner_size.height() + bottom_left_corner_size.height(),
|
||||||
top_right_corner_size.height() + bottom_right_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);
|
+ 1 + blurred_edge_thickness);
|
||||||
|
|
||||||
auto top_left_corner_rect = DevicePixelRect {
|
auto top_left_corner_rect = DevicePixelRect {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue