From: compudj Date: Tue, 23 May 2006 20:00:21 +0000 (+0000) Subject: fix compare X-Git-Tag: v0.12.20~1650 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9e494e53b1dd377feb6c786d18f98897714d852d;p=lttv.git fix compare git-svn-id: http://ltt.polymtl.ca/svn@1839 04897980-b3bd-0310-b5e0-8ef037075253 --- 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);