From cd04f42432a6a036f2f6359d7ec716ad5febc484 Mon Sep 17 00:00:00 2001 From: Noah Davis Date: Mon, 18 Feb 2019 17:01:19 -0500 Subject: [PATCH] Multiply radius by 0.5 in calculateBlurStdDev() Summary: Fix TODO to follow w3.org standard for shadow-blur Reviewers: #breeze, ngraham Reviewed By: #breeze, ngraham Subscribers: ngraham, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D19134 --- libbreezecommon/breezeboxshadowrenderer.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libbreezecommon/breezeboxshadowrenderer.cpp b/libbreezecommon/breezeboxshadowrenderer.cpp index 8203b5b3..5f5890c8 100644 --- a/libbreezecommon/breezeboxshadowrenderer.cpp +++ b/libbreezecommon/breezeboxshadowrenderer.cpp @@ -45,13 +45,7 @@ static inline int calculateBlurRadius(qreal stdDev) static inline qreal calculateBlurStdDev(int radius) { - // https://www.w3.org/TR/css-backgrounds-3/#shadow-blur says that the resulting - // shadow must approximate the image that would be generated by applying to the - // shadow a Gaussian blur with a standard deviation equal to half the blur radius, - // but we had been using a slightly different (non-standard compliant) routine to - // derive the standard deviation before, so in order to not break existing shadow - // params, we're not following the standard. - return radius * 0.43; // TODO: Multiply by 0.5 instead. + return radius * 0.5; } static inline QSize calculateBlurExtent(int radius)