do not recalculate time width..
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 13 Aug 2004 20:51:03 +0000 (20:51 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 13 Aug 2004 20:51:03 +0000 (20:51 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@732 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c
ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h
ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c

index f395d8ce9078f530309bce8b192765eda1f92659..3a15130c9cccd404cc27e579bb52e41a57605659 100644 (file)
@@ -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);
   
index 0dd8ae892fffa9cf973964bb2a1af3478b2ec0c9..d07ed4e771e1262fd6c15526a5d426cf3722210a 100644 (file)
@@ -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,
index 197436ef09b70c0e5076010209c33536bf0a365e..f4b77bcec22f5816c20ba6b47934494e0fd19715 100644 (file)
@@ -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(ns<os+w<ns+w)
@@ -2572,6 +2584,7 @@ gint update_time_window_hook(void *hook_data, void *call_data)
       guint width = control_flow_data->drawing->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,
This page took 0.047567 seconds and 4 git commands to generate.