fix compare
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 23 May 2006 20:00:21 +0000 (20:00 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 23 May 2006 20:00:21 +0000 (20:00 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1839 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c

index 4f2a9639e40fcd0fa4b201c835917764d27c1ff5..d6763a226b473f131aae00a911b196b63e30bfe3 100644 (file)
@@ -2171,7 +2171,8 @@ void zoom(GtkWidget * widget, double size)
       new_time_window.end_time = ltt_time_add(new_time_window.start_time,
                                             new_time_window.time_width) ;
       /* If on borders, don't fall off */
-      if(ltt_time_compare(new_time_window.start_time, time_span.start_time) <0)
+      if(ltt_time_compare(new_time_window.start_time, time_span.start_time) <0
+       || ltt_time_compare(new_time_window.start_time, time_span.end_time) >0)
       {
         new_time_window.start_time = time_span.start_time;
         new_time_window.end_time = ltt_time_add(new_time_window.start_time,
@@ -2180,7 +2181,9 @@ void zoom(GtkWidget * widget, double size)
       else 
       {
         if(ltt_time_compare(new_time_window.end_time,
-                            time_span.end_time) > 0)
+                            time_span.end_time) > 0
+         || ltt_time_compare(new_time_window.end_time,
+                            time_span.start_time) < 0)
         {
           new_time_window.start_time = 
                   ltt_time_sub(time_span.end_time, new_time_window.time_width);
This page took 0.026385 seconds and 4 git commands to generate.