diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-18 11:54:31 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-18 11:54:31 +1000 |
commit | 9533c8d0a50c2e09d4880776f5ddfda2b7482c32 (patch) | |
tree | 8b21c4ea131b736517ed8a501c49cbbb44b08595 /source/core/StarImageProcessing.cpp | |
parent | 5bf3b20542c62c656cf90c71774189b7ab69fef5 (diff) |
Fix ?border behaving slightly different to vanilla (due to alterations for font directives)
Diffstat (limited to 'source/core/StarImageProcessing.cpp')
-rw-r--r-- | source/core/StarImageProcessing.cpp | 6 |
1 files 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<int>::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); |