From c2ca01a5c5649efed3aa452b7625ead7b92ffbba Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Sun, 20 Aug 2023 09:18:47 +0200 Subject: [PATCH] common: shape's composition fixed In the case of a gradient stroke and a valid fill, the composition wasn't applied correctly, resulting in an unexpected overlap between the fill and stroke. @Issue: https://github.com/thorvg/thorvg/issues/445 --- src/lib/tvgShapeImpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/tvgShapeImpl.h b/src/lib/tvgShapeImpl.h index 630c7c47..edc4f365 100644 --- a/src/lib/tvgShapeImpl.h +++ b/src/lib/tvgShapeImpl.h @@ -70,7 +70,7 @@ struct Shape::Impl if (opacity == 0) return false; //Shape composition is only necessary when stroking & fill are valid. - if (!rs.stroke || rs.stroke->width < FLT_EPSILON || rs.stroke->color[3] == 0) return false; + if (!rs.stroke || rs.stroke->width < FLT_EPSILON || (!rs.stroke->fill && rs.stroke->color[3] == 0)) return false; if (!rs.fill && rs.color[3] == 0) return false; //translucent fill & stroke