From 9533c8d0a50c2e09d4880776f5ddfda2b7482c32 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:54:31 +1000 Subject: [PATCH] Fix ?border behaving slightly different to vanilla (due to alterations for font directives) --- source/core/StarImageProcessing.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/core/StarImageProcessing.cpp b/source/core/StarImageProcessing.cpp index 98f65f4..51cee0f 100644 --- a/source/core/StarImageProcessing.cpp +++ b/source/core/StarImageProcessing.cpp @@ -591,8 +591,8 @@ void processImageOperation(ImageOperation const& operation, Image& image, ImageR if (dist < std::numeric_limits::max()) { float percent = (dist - 1) / (2.0f * pixels - 1); - Color color = Color::rgba(op->startColor).mix(Color::rgba(op->endColor), percent); if (pixel[3] != 0) { + Color color = Color::rgba(op->startColor).mix(Color::rgba(op->endColor), percent); if (op->outlineOnly) { float pixelA = byteToFloat(pixel[3]); color.setAlphaF((1.0f - pixelA) * fminf(pixelA, 0.5f) * 2.0f); @@ -607,8 +607,10 @@ void processImageOperation(ImageOperation const& operation, Image& image, ImageR color.convertToSRGB(); color.setAlphaF(colorA); } + pixel = color.toRgba(); + } else { + pixel = Vec4B(Vec4F(op->startColor) * (1 - percent) + Vec4F(op->endColor) * percent); } - pixel = color.toRgba(); } } else if (op->outlineOnly) { pixel = Vec4B(0, 0, 0, 0);