[longomatch] Use a circle for the selection



commit a54673a658316355e8f952b49ff802e5a229e19d
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Apr 14 12:59:36 2015 +0200

    Use a circle for the selection
    
    Otherwise link lines can't be selected as the anchor is
    always selected first.

 .../CanvasObjects/Dashboard/LinkAnchorObject.cs    |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/LongoMatch.Drawing/CanvasObjects/Dashboard/LinkAnchorObject.cs 
b/LongoMatch.Drawing/CanvasObjects/Dashboard/LinkAnchorObject.cs
index 40a1551..08af72a 100644
--- a/LongoMatch.Drawing/CanvasObjects/Dashboard/LinkAnchorObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/Dashboard/LinkAnchorObject.cs
@@ -27,8 +27,8 @@ namespace LongoMatch.Drawing.CanvasObjects.Dashboard
        public class LinkAnchorObject: CanvasObject, ICanvasSelectableObject
        {
 
-               Rectangle rect;
-
+               readonly Circle circle;
+               const int radius = 5;
 
                public LinkAnchorObject (DashboardButtonObject button, List<Tag> tags, Point relPos)
                {
@@ -36,7 +36,7 @@ namespace LongoMatch.Drawing.CanvasObjects.Dashboard
                        Width = button.Width;
                        Height = button.Height;
                        Button = button;
-                       rect = new Rectangle (Position, Width, Height);
+                       circle = new Circle (Center, radius);
                        if (tags == null)
                                tags = new List<Tag> ();
                        Tags = tags;
@@ -103,8 +103,8 @@ namespace LongoMatch.Drawing.CanvasObjects.Dashboard
                {
                        Selection sel;
 
-                       rect = new Rectangle (Position, Width, Height);
-                       sel = rect.GetSelection (point, precision, inMotion);
+                       circle.Center = Center;
+                       sel = circle.GetSelection (point, precision, inMotion);
                        if (sel != null) {
                                sel.Drawable = this;
                                sel.Position = SelectionPosition.All;


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