From 41c11711975bbd544bec581ec1a3628e8b32855c Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Tue, 22 Oct 2024 13:31:44 +0900 Subject: [PATCH] sw_engine: corrected the blur feathering region. issue: https://github.com/thorvg/thorvg/issues/2892 --- src/renderer/sw_engine/tvgSwPostEffect.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/renderer/sw_engine/tvgSwPostEffect.cpp b/src/renderer/sw_engine/tvgSwPostEffect.cpp index ad799525..4aea7d5c 100644 --- a/src/renderer/sw_engine/tvgSwPostEffect.cpp +++ b/src/renderer/sw_engine/tvgSwPostEffect.cpp @@ -37,13 +37,12 @@ struct SwGaussianBlur static void _gaussianExtendRegion(RenderRegion& region, int extra, int8_t direction) { //bbox region expansion for feathering - if (direction == 0 || direction == 1) { + if (direction != 2) { region.x = -extra; - region.y = -extra; - } - - if (direction == 0 || direction == 2) { region.w = extra * 2; + } + if (direction != 1) { + region.y = -extra; region.h = extra * 2; } }