From 9be65e35b5095ffdb7d5abe457d3eec364d75dfc Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sun, 26 May 2024 15:16:08 +0100 Subject: [PATCH] Revert "LibGfx+LibWeb: Do not ignore corner radius if it is defined..." This reverts commit 6b7b9ca1c4b32e76e0afef6bca0cb300e615b576. The whole corner radius is invisible if it has 0 radius in any axis, so the reverted commit was a mistake that led to error checking during painting command execution b61aab66d99923c1b887836f4c1741fffba20831 to avoid crashing on attempt to allocate 0 size bitmap. --- Userland/Libraries/LibGfx/AntiAliasingPainter.h | 2 +- Userland/Libraries/LibWeb/Painting/BorderRadiiData.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGfx/AntiAliasingPainter.h b/Userland/Libraries/LibGfx/AntiAliasingPainter.h index e66b77c952d..3ec5248f5d4 100644 --- a/Userland/Libraries/LibGfx/AntiAliasingPainter.h +++ b/Userland/Libraries/LibGfx/AntiAliasingPainter.h @@ -63,7 +63,7 @@ public: inline operator bool() const { - return horizontal_radius > 0 || vertical_radius > 0; + return horizontal_radius > 0 && vertical_radius > 0; } Gfx::IntRect as_rect() const diff --git a/Userland/Libraries/LibWeb/Painting/BorderRadiiData.h b/Userland/Libraries/LibWeb/Painting/BorderRadiiData.h index 625cd319486..99853d96347 100644 --- a/Userland/Libraries/LibWeb/Painting/BorderRadiiData.h +++ b/Userland/Libraries/LibWeb/Painting/BorderRadiiData.h @@ -21,7 +21,7 @@ struct BorderRadiusData { inline operator bool() const { - return horizontal_radius > 0 || vertical_radius > 0; + return horizontal_radius > 0 && vertical_radius > 0; } inline void shrink(CSSPixels horizontal, CSSPixels vertical)