forked from 0xC0000054/pdn-photoshop-brush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSampledBrushCollection.cs
44 lines (40 loc) · 1.37 KB
/
SampledBrushCollection.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com/
//
// ABR FileType Plugin for Paint.NET
//
// This software is provided under the MIT License:
// Copyright (c) 2012-2017 Nicholas Hayes
//
// See LICENSE.txt for complete licensing and attribution information.
//
//github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com///github.com/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace AbrFileTypePlugin
{
internal sealed class SampledBrushCollection : Collection<SampledBrush>
{
//github.com/ <summary>
//github.com/ Finds the largest diameter brush matching the specified tag.
//github.com/ </summary>
//github.com/ <param name="tag">The tag.</param>
//github.com/ <returns>The largest diameter brush matching the specified tag.</returns>
public SampledBrush FindBrush(string tag)
{
IList<SampledBrush> items = this.Items;
SampledBrush brush = null;
int maxDiameter = 0;
for (int i = 0; i < items.Count; i++)
{
SampledBrush item = items[i];
if (item.Tag.Equals(tag, StringComparison.Ordinal) && item.Diameter > maxDiameter)
{
maxDiameter = item.Diameter;
brush = item;
}
}
return brush;
}
}
}