From 2cd8edefdc6892a71ef06bcb597ab3b79db4a5c5 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 8 Aug 2023 14:52:51 +0200 Subject: [PATCH] BlendPictureBox - Moved color check when applying blend --- PCK-Studio/Classes/ToolboxItems/BlendPictureBox.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PCK-Studio/Classes/ToolboxItems/BlendPictureBox.cs b/PCK-Studio/Classes/ToolboxItems/BlendPictureBox.cs index 82857ab4..e66ff10f 100644 --- a/PCK-Studio/Classes/ToolboxItems/BlendPictureBox.cs +++ b/PCK-Studio/Classes/ToolboxItems/BlendPictureBox.cs @@ -24,11 +24,7 @@ namespace PckStudio.ToolboxItems public Color BlendColor { get => _blendColor; - set - { - UseBlendColor = value != Color.White; - _blendColor = value; - } + set => _blendColor = value; } [DefaultValue(typeof(BlendMode), "BlendMode.Add")] @@ -46,7 +42,11 @@ namespace PckStudio.ToolboxItems public new Image Image { get => base.Image; - set => base.Image = UseBlendColor ? value.Blend(BlendColor, BlendMode) : value; + set { + if (value is null) + return; + base.Image = UseBlendColor && BlendColor != Color.White ? value.Blend(BlendColor, BlendMode) : value; + } } } }