From c23967b547e8428fa694cad4dc27637ddd846434 Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 29 Mar 2017 17:35:09 -0300 Subject: [PATCH] Fix soft light layer blending mode --- src/doc/blend_funcs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/blend_funcs.cpp b/src/doc/blend_funcs.cpp index 134d2cb6e..1edd0b2de 100644 --- a/src/doc/blend_funcs.cpp +++ b/src/doc/blend_funcs.cpp @@ -1,5 +1,5 @@ // Aseprite Document Library -// Copyright (c) 2001-2016 David Capello +// Copyright (c) 2001-2017 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. @@ -73,9 +73,9 @@ inline uint32_t blend_soft_light(uint32_t _b, uint32_t _s) d = std::sqrt(b); if (s <= 0.5) - r = b - (1.0 - 2.0*s) * b * (1.0 - b); + r = b - (1.0 - 2.0 * s) * b * (1.0 - b); else - r = b - (1.0 - 2.0*s) * b * (1.0 - b); + r = b + (2.0 * s - 1.0) * (d - b); return (uint32_t)(r * 255 + 0.5); }