1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 10:08:31 +00:00

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

This commit is contained in:
Darth Affe 2021-02-22 21:09:51 +01:00
parent 520fb38602
commit dade203c94

View File

@ -47,7 +47,7 @@ namespace RGB.NET.Core
#region Methods #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) foreach (RenderTarget renderTarget in renderTargets)
{ {
@ -66,6 +66,8 @@ namespace RGB.NET.Core
/// <param name="color">The <see cref="Color"/> to be modified.</param> /// <param name="color">The <see cref="Color"/> to be modified.</param>
protected virtual void ApplyDecorators(in Rectangle rectangle, in RenderTarget renderTarget, ref Color color) protected virtual void ApplyDecorators(in Rectangle rectangle, in RenderTarget renderTarget, ref Color color)
{ {
if (Decorators.Count == 0) return;
lock (Decorators) lock (Decorators)
foreach (IBrushDecorator decorator in Decorators) foreach (IBrushDecorator decorator in Decorators)
if (decorator.IsEnabled) if (decorator.IsEnabled)