[longomatch] Only redraw the event time if the seconds changed



commit 012356f4c90afaf590f74f12158a1506502f6ac7
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Oct 24 14:39:03 2014 +0200

    Only redraw the event time if the seconds changed

 LongoMatch.Drawing/CanvasObjects/CategoryObject.cs |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/LongoMatch.Drawing/CanvasObjects/CategoryObject.cs 
b/LongoMatch.Drawing/CanvasObjects/CategoryObject.cs
index 942bb3e..f73c310 100644
--- a/LongoMatch.Drawing/CanvasObjects/CategoryObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/CategoryObject.cs
@@ -51,7 +51,7 @@ namespace LongoMatch.Drawing.CanvasObjects
                        rects = new Dictionary <Rectangle, object> ();
                        buttonsRects = new Dictionary <Rectangle, object> ();
                        SelectedTags = new List<Tag> ();
-                       CurrentTime = new Time (0);
+                       currentTime = new Time (0);
                        cancelRect = new Rectangle (new Point (0, 0), 0, 0);
                        editRect = new Rectangle (new Point (0, 0), 0, 0);
                        applyRect = new Rectangle (new Point (0, 0), 0, 0);
@@ -88,11 +88,14 @@ namespace LongoMatch.Drawing.CanvasObjects
                                return currentTime;
                        }
                        set {
+                               bool secsChanged = currentTime.Seconds != value.Seconds;
                                currentTime = value;
-                               if (Start != null && currentTime < Start) {
-                                       Clear ();
-                               } else {
-                                       ReDraw ();
+                               if (Start != null) {
+                                       if (currentTime < Start) {
+                                               Clear ();
+                                       } else if (secsChanged) {
+                                               ReDraw ();
+                                       }
                                }
                        }
                }


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