Changed Brush Render-Method to be virtual; Added list not empty check to Decorator application

This commit is contained in:
DarthAffe committed 2021-02-22 21:09:51 +01:00
1 parent 520fb38602
commit dade203c94
1 file changed
+3 -1
@@ -47,7 +47,7 @@ namespace RGB.NET.Core
#region Methods
public IEnumerable<(RenderTarget renderTarget, Color color)> Render(Rectangle rectangle, IEnumerable<RenderTarget> renderTargets)
public virtual IEnumerable<(RenderTarget renderTarget, Color color)> Render(Rectangle rectangle, IEnumerable<RenderTarget> renderTargets)
{
foreach (RenderTarget renderTarget in renderTargets)
{
@@ -66,6 +66,8 @@ namespace RGB.NET.Core
/// <param name="color">The <see cref="Color"/> to be modified.</param>
protected virtual void ApplyDecorators(in Rectangle rectangle, in RenderTarget renderTarget, ref Color color)
{
if (Decorators.Count == 0) return;
lock (Decorators)
foreach (IBrushDecorator decorator in Decorators)
if (decorator.IsEnabled)