1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

LibWeb: Check if corners have radius after converting to device pixels

Check needs to happen after conversion because non-zero radius in
CSSPixels could turn into zero in device pixels.

Fixes https://github.com/SerenityOS/serenity/issues/22765
This commit is contained in:
Aliaksandr Kalenik 2024-01-15 14:23:08 +01:00 committed by Andreas Kling
parent 6087d2feec
commit 64a48065b0
4 changed files with 27 additions and 5 deletions

View file

@ -438,7 +438,7 @@ void PaintableBox::apply_clip_overflow_rect(PaintContext& context, PaintPhase ph
.bottom_right = border_radii_data.bottom_right.as_corner(context),
.bottom_left = border_radii_data.bottom_left.as_corner(context)
};
if (border_radii_data.has_any_radius()) {
if (corner_radii.has_any_radius()) {
VERIFY(!m_corner_clipper_id.has_value());
m_corner_clipper_id = context.allocate_corner_clipper_id();
context.recording_painter().sample_under_corners(*m_corner_clipper_id, corner_radii, context.rounded_device_rect(*clip_rect).to_type<int>(), CornerClip::Outside);
@ -648,7 +648,7 @@ void PaintableWithLines::paint(PaintContext& context, PaintPhase phase) const
.bottom_right = border_radii.bottom_right.as_corner(context),
.bottom_left = border_radii.bottom_left.as_corner(context)
};
if (border_radii.has_any_radius()) {
if (corner_radii.has_any_radius()) {
corner_clip_id = context.allocate_corner_clipper_id();
context.recording_painter().sample_under_corners(*corner_clip_id, corner_radii, clip_box.to_type<int>(), CornerClip::Outside);
}