[longomatch] Use the button's width and height when not set



commit 043462cee9ebec48f7620f2fd0eec759863ef61c
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Apr 22 12:29:48 2015 +0200

    Use the button's width and height when not set

 .../CanvasObjects/Dashboard/LinkAnchorObject.cs    |   25 +++++++++++++++----
 1 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/LongoMatch.Drawing/CanvasObjects/Dashboard/LinkAnchorObject.cs 
b/LongoMatch.Drawing/CanvasObjects/Dashboard/LinkAnchorObject.cs
index c78c0cb..f3d8d9b 100644
--- a/LongoMatch.Drawing/CanvasObjects/Dashboard/LinkAnchorObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/Dashboard/LinkAnchorObject.cs
@@ -37,12 +37,13 @@ namespace LongoMatch.Drawing.CanvasObjects.Dashboard
                readonly int iconWidth;
                readonly int iconHeight;
                const int radius = 5;
+               double width;
+               double height;
 
                public LinkAnchorObject (DashboardButtonObject button, List<Tag> tags, Point relPos)
                {
                        RelativePosition = relPos;
-                       Width = button.Width;
-                       Height = button.Height;
+                       width = height = 0;
                        Button = button;
                        if (tags == null)
                                tags = new List<Tag> ();
@@ -63,13 +64,25 @@ namespace LongoMatch.Drawing.CanvasObjects.Dashboard
                }
 
                public double Width {
-                       get;
-                       set;
+                       get {
+                               if (width == 0)
+                                       return Button.Width;
+                               return width;
+                       }
+                       set {
+                               width = value;
+                       }
                }
 
                public double Height {
-                       get;
-                       set;
+                       get {
+                               if (height == 0)
+                                       return Button.Height;
+                               return height;
+                       }
+                       set {
+                               height = value;
+                       }
                }
 
                public List<Tag> Tags {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]