From 47d1b41fb59c7adfb48871131b6a254709543cca Mon Sep 17 00:00:00 2001 From: wcout Date: Wed, 22 Nov 2023 19:43:04 +0100 Subject: [PATCH] Fix #240 --- src/nanosvgrast.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nanosvgrast.h b/src/nanosvgrast.h index bcaefc1..89fae38 100644 --- a/src/nanosvgrast.h +++ b/src/nanosvgrast.h @@ -1283,7 +1283,7 @@ static void nsvg__initPaint(NSVGcachedPaint* cache, NSVGpaint* paint, float opac if (grad->nstops == 0) { for (i = 0; i < 256; i++) cache->colors[i] = 0; - } if (grad->nstops == 1) { + } else if (grad->nstops == 1) { for (i = 0; i < 256; i++) cache->colors[i] = nsvg__applyOpacity(grad->stops[i].color, opacity); } else {