Only apply the first blur and brightness filters

(cherry picked from commit 73ddbc8ac919b2400d446f0cf36191c9ecd55846)
This commit is contained in:
nathbrow 2025-07-17 13:37:32 -07:00 committed by Nathan
commit d0bbb6d059
2 changed files with 26 additions and 1 deletions

View file

@ -57,6 +57,9 @@ namespace Greenshot.Editor.Drawing
private const int M11 = 0;
private const int M22 = 3;
public static bool IsBlurFilterApplied = false;
public static bool IsBrightnessFilterApplied = false;
[OnDeserialized]
private void OnDeserializedInit(StreamingContext context)
{
@ -415,8 +418,27 @@ namespace Greenshot.Editor.Drawing
foreach (IFilter filter in Filters)
{
if (filter.Invert)
{
if (filter is BlurFilter)
{
if (!IsBlurFilterApplied)
{
filter.Apply(graphics, bmp, Bounds, renderMode, areasToExcludeFromFilters);
IsBlurFilterApplied = true;
}
}
else if (filter is BrightnessFilter)
{
if (!IsBrightnessFilterApplied)
{
filter.Apply(graphics, bmp, Bounds, renderMode, areasToExcludeFromFilters);
IsBrightnessFilterApplied = true;
}
}
else
{
filter.Apply(graphics, bmp, Bounds, renderMode, areasToExcludeFromFilters);
}
}
else
{

View file

@ -328,6 +328,9 @@ namespace Greenshot.Editor.Drawing
return;
}
DrawableContainer.IsBlurFilterApplied = false;
DrawableContainer.IsBrightnessFilterApplied = false;
foreach (var drawableContainer in this)
{
var dc = (DrawableContainer) drawableContainer;