aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/Rectangles.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-17 08:44:34 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-17 08:44:34 +0100
commita8156b149f2e4a3c087bcb090db293d08116bd67 (patch)
tree51dd4165422863f70c656de8e0bbfa7c079142bb /src/Rectangles.cs
parent3c1dbdbbc58d38d45276e3147c3717d19a69adf2 (diff)
parentbf27b88a6cbfcc65d7ed6360f9193d52f96b1598 (diff)
Merge branch 'DefTemplateSizing0'
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;