1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:27:35 +00:00

LibWeb: Shrink the inner border radii to accommodate the border widths

This fixes the shape of the subreddit logo on new reddit.
This commit is contained in:
MacDue 2022-07-26 20:43:53 +01:00 committed by Linus Groh
parent 890514a057
commit b68f48eb71
5 changed files with 16 additions and 10 deletions

View file

@ -32,7 +32,7 @@ void CanvasPaintable::paint(PaintContext& context, PaintPhase phase) const
if (phase == PaintPhase::Foreground) {
auto canvas_rect = absolute_rect().to_rounded<int>();
ScopedCornerRadiusClip corner_clip { context.painter(), canvas_rect, normalized_border_radii_data() };
ScopedCornerRadiusClip corner_clip { context.painter(), canvas_rect, normalized_border_radii_data(ShrinkRadiiForBorders::Yes) };
// FIXME: This should be done at a different level. Also rect() does not include padding etc!
if (!context.viewport_rect().intersects(canvas_rect))