BlendPictureBox - Moved color check when applying blend

This commit is contained in:
miku-666
2023-08-08 14:52:51 +02:00
parent 549470180e
commit 2cd8edefdc

View File

@@ -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;
}
}
}
}