From 9e494e53b1dd377feb6c786d18f98897714d852d Mon Sep 17 00:00:00 2001 From: compudj Date: Tue, 23 May 2006 20:00:21 +0000 Subject: [PATCH] fix compare git-svn-id: http://ltt.polymtl.ca/svn@1839 04897980-b3bd-0310-b5e0-8ef037075253 --- .../lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c index 4f2a9639..d6763a22 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c @@ -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); -- 2.34.1