From 4fbb4392ba79077ea9039d61d3063bfb00bb44ad Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Tue, 20 Dec 2022 15:48:13 -0600 Subject: [PATCH] Fix Transition/Mask `replace_image` Property (#888) * Fix ColorShift bug when only adjusting the Y keyframes * Fixing 'replace-image' functionality of the Mask / Transition effect - used for debugging masks --- src/effects/Mask.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/effects/Mask.cpp b/src/effects/Mask.cpp index 442b2307..428e53b8 100644 --- a/src/effects/Mask.cpp +++ b/src/effects/Mask.cpp @@ -123,10 +123,10 @@ std::shared_ptr Mask::GetFrame(std::shared_ptr // Set the alpha channel to the gray value if (replace_image) { // Replace frame pixels with gray value (including alpha channel) - pixels[byte_index + 0] = gray_value; - pixels[byte_index + 1] = gray_value; - pixels[byte_index + 2] = gray_value; - pixels[byte_index + 3] = gray_value; + pixels[byte_index + 0] = constrain(255 * alpha_percent); + pixels[byte_index + 1] = constrain(255 * alpha_percent); + pixels[byte_index + 2] = constrain(255 * alpha_percent); + pixels[byte_index + 3] = constrain(255 * alpha_percent); } else { // Mulitply new alpha value with all the colors (since we are using a premultiplied // alpha format)