From 20640e7057725a118fcca68e8675946561293a75 Mon Sep 17 00:00:00 2001 From: compudj Date: Fri, 13 Aug 2004 20:51:03 +0000 Subject: [PATCH] do not recalculate time width.. git-svn-id: http://ltt.polymtl.ca/svn@732 04897980-b3bd-0310-b5e0-8ef037075253 --- .../poly/lttv/modules/gui/controlflow/drawing.c | 14 +++++++++----- .../poly/lttv/modules/gui/controlflow/drawing.h | 2 ++ .../lttv/modules/gui/controlflow/eventhooks.c | 15 +++++++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c index f395d8ce..3a15130c 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c @@ -139,11 +139,13 @@ void drawing_data_request(Drawing_t *drawing, convert_pixels_to_time(drawing->width, x, time_window.start_time, + time_window.time_width, window_end, &start); convert_pixels_to_time(drawing->width, x+width, time_window.start_time, + time_window.time_width, window_end, &time_end); @@ -405,6 +407,7 @@ void drawing_data_request_begin(EventsRequest *events_request, LttvTracesetState convert_time_to_pixels( time_window.start_time, + time_window.time_width, end_time, events_request->start_time, width, @@ -446,6 +449,7 @@ void drawing_request_expose(EventsRequest *events_request, #if 0 convert_time_to_pixels( time_window.start_time, + time_window.time_width, window_end, cfd->drawing->last_start, drawing->width, @@ -454,6 +458,7 @@ void drawing_request_expose(EventsRequest *events_request, #endif //0 convert_time_to_pixels( time_window.start_time, + time_window.time_width, window_end, end_time, drawing->width, @@ -610,6 +615,7 @@ expose_event( GtkWidget *widget, GdkEventExpose *event, gpointer user_data ) /* Draw the dotted lines */ convert_time_to_pixels( time_window.start_time, + time_window.time_width, window_end, current_time, drawing->width, @@ -699,6 +705,7 @@ button_press_event( GtkWidget *widget, GdkEventButton *event, gpointer user_data convert_pixels_to_time(drawing->width, (guint)event->x, time_window.start_time, + time_window.time_width, window_end, &time); @@ -927,14 +934,12 @@ __inline void convert_pixels_to_time( gint width, guint x, LttTime window_time_begin, + LttTime window_time_interval, LttTime window_time_end, LttTime *time) { - LttTime window_time_interval; double time_d; - window_time_interval = ltt_time_sub(window_time_end, - window_time_begin); time_d = ltt_time_to_double(window_time_interval); time_d = time_d / (double)width * (double)x; *time = ltt_time_from_double(time_d); @@ -944,18 +949,17 @@ __inline void convert_pixels_to_time( __inline void convert_time_to_pixels( LttTime window_time_begin, + LttTime window_time_interval, LttTime window_time_end, LttTime time, int width, guint *x) { - LttTime window_time_interval; double time_d, interval_d; #ifdef EXTRA_CHECK g_assert(ltt_time_compare(window_time_begin, time) <= 0 && ltt_time_compare(window_time_end, time) >= 0); #endif //EXTRA_CHECK - window_time_interval = ltt_time_sub(window_time_end,window_time_begin); time = ltt_time_sub(time, window_time_begin); diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h index 0dd8ae89..d07ed4e7 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h @@ -138,11 +138,13 @@ __inline void convert_pixels_to_time( gint width, guint x, LttTime window_time_begin, + LttTime window_time_interval, LttTime window_time_end, LttTime *time); __inline void convert_time_to_pixels( LttTime window_time_begin, + LttTime window_time_interval, LttTime window_time_end, LttTime time, gint width, diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c index 197436ef..f4b77bce 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c @@ -484,6 +484,7 @@ int before_schedchange_hook(void *hook_data, void *call_data) guint x; convert_time_to_pixels( time_window.start_time, + time_window.time_width, end_time, evtime, width, @@ -608,6 +609,7 @@ int before_schedchange_hook(void *hook_data, void *call_data) convert_time_to_pixels( time_window.start_time, + time_window.time_width, end_time, evtime, width, @@ -803,6 +805,7 @@ int before_schedchange_hook(void *hook_data, void *call_data) convert_time_to_pixels( time_window.start_time, + time_window.time_width, window_end, time, width, @@ -1379,6 +1382,7 @@ int after_schedchange_hook(void *hook_data, void *call_data) convert_time_to_pixels( time_window.start_time, + time_window.time_width, end_time, evtime, width, @@ -1532,6 +1536,7 @@ int after_schedchange_hook(void *hook_data, void *call_data) //convert_time_to_pixels( // time_window->start_time, + // time_window.time_width, // window_end, // time, // width, @@ -1992,6 +1997,7 @@ int before_execmode_hook(void *hook_data, void *call_data) convert_time_to_pixels( time_window.start_time, + time_window.time_width, end_time, evtime, width, @@ -2138,6 +2144,7 @@ int after_execmode_hook(void *hook_data, void *call_data) convert_time_to_pixels( time_window.start_time, + time_window.time_width, end_time, evtime, width, @@ -2260,6 +2267,7 @@ int before_process_hook(void *hook_data, void *call_data) convert_time_to_pixels( time_window.start_time, + time_window.time_width, end_time, evtime, width, @@ -2425,6 +2433,7 @@ int after_process_hook(void *hook_data, void *call_data) guint new_x; convert_time_to_pixels( time_window.start_time, + time_window.time_width, end_time, evtime, width, @@ -2497,6 +2506,7 @@ int after_process_hook(void *hook_data, void *call_data) guint new_x; convert_time_to_pixels( time_window.start_time, + time_window.time_width, end_time, evtime, width, @@ -2557,7 +2567,9 @@ gint update_time_window_hook(void *hook_data, void *call_data) /* Same scale (scrolling) */ g_info("scrolling"); LttTime *ns = &new_time_window->start_time; + LttTime *nw = &new_time_window->time_width; LttTime *os = &old_time_window->start_time; + LttTime *ow = &old_time_window->time_width; LttTime old_end = old_time_window->end_time; LttTime new_end = new_time_window->end_time; //if(nsdrawing->width; convert_time_to_pixels( *os, + *ow, old_end, *ns, width, @@ -2625,6 +2638,7 @@ gint update_time_window_hook(void *hook_data, void *call_data) guint width = control_flow_data->drawing->width; convert_time_to_pixels( *ns, + *nw, new_end, *os, width, @@ -2999,6 +3013,7 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data) convert_time_to_pixels( time_window.start_time, + time_window.time_width, end_time, evtime, width, -- 2.34.1