From c196a32ebc56454847ada5e430202d2cb503af78 Mon Sep 17 00:00:00 2001 From: mrtripie <65431647+mrtripie@users.noreply.github.com> Date: Thu, 19 Aug 2021 09:49:14 -0400 Subject: [PATCH] Fixed issues with Shading tool Saturation and Value not always being right in Hue Shading mode (#519) Co-authored-by: MrTriPie --- src/Tools/Shading.gd | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Tools/Shading.gd b/src/Tools/Shading.gd index 8d91aa2f1..d50225fb1 100644 --- a/src/Tools/Shading.gd +++ b/src/Tools/Shading.gd @@ -56,20 +56,16 @@ class LightenDarkenOp extends Drawer.ColorOp: if lighten_or_darken == LightenDarken.LIGHTEN: hue_shift = hue_limit_lighten(dst.h, hue_shift) dst.h += hue_shift - dst.s -= sat_shift + if dst.s > sat_lighten_limit: + dst.s = max(dst.s - min(sat_shift, dst.s), sat_lighten_limit) dst.v += value_shift - if dst.s < sat_lighten_limit: - dst.v = prev_value - dst.s = prev_sat - dst.h = prev_hue else: hue_shift = hue_limit_darken(dst.h, hue_shift) dst.h -= hue_shift dst.s += sat_shift - dst.v -= value_shift - if dst.v < value_darken_limit: - dst.v = prev_value + if dst.v > value_darken_limit: + dst.v = max(dst.v - min(value_shift, dst.v), value_darken_limit) return dst