mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 06:45:07 +00:00

We also pass whether the shadow goes inside or outside the element. Only outer shadows are rendered currently, and inner ones may want to be handled separately from them, as they will never interfere with each other.
30 lines
542 B
C++
30 lines
542 B
C++
/*
|
|
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGfx/Color.h>
|
|
#include <LibWeb/Painting/PaintContext.h>
|
|
|
|
namespace Web::Painting {
|
|
|
|
enum class BoxShadowPlacement {
|
|
Outer,
|
|
Inner,
|
|
};
|
|
|
|
struct BoxShadowData {
|
|
Gfx::Color color;
|
|
int offset_x;
|
|
int offset_y;
|
|
int blur_radius;
|
|
int spread_distance;
|
|
BoxShadowPlacement placement;
|
|
};
|
|
|
|
void paint_box_shadow(PaintContext&, Gfx::IntRect const&, Vector<BoxShadowData> const&);
|
|
|
|
}
|