mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 21:43:24 -07:00
Only apply the first blur and brightness filters
(cherry picked from commit 73ddbc8ac919b2400d446f0cf36191c9ecd55846)
This commit is contained in:
parent
dd0cdf4724
commit
d0bbb6d059
2 changed files with 26 additions and 1 deletions
|
@ -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
|
||||
{
|
||||
|
|
|
@ -328,6 +328,9 @@ namespace Greenshot.Editor.Drawing
|
|||
return;
|
||||
}
|
||||
|
||||
DrawableContainer.IsBlurFilterApplied = false;
|
||||
DrawableContainer.IsBrightnessFilterApplied = false;
|
||||
|
||||
foreach (var drawableContainer in this)
|
||||
{
|
||||
var dc = (DrawableContainer) drawableContainer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue