aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/Rectangles.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Rectangles.cs')
-rw-r--r--src/Rectangles.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Rectangles.cs b/src/Rectangles.cs
index c507b2ba..5168f3db 100644
--- a/src/Rectangles.cs
+++ b/src/Rectangles.cs
@@ -171,11 +171,15 @@ namespace Crow
Rectangle _bounds;
bool boundsUpToDate = true;
public Rectangle Bounds {
- get {
+ get {
if (!boundsUpToDate) {
- _bounds = Rectangle.Empty;
- foreach (Rectangle rInList in list)
- _bounds += rInList;
+ if (list.Count > 0) {
+ _bounds = list [0];
+ for (int i = 1; i < list.Count; i++) {
+ _bounds += list [i];
+ }
+ } else
+ _bounds = Rectangle.Empty;
boundsUpToDate = true;
}
return _bounds;