Add state saving functions and update processTrace accordingly.
[lttv.git] / ltt / branches / poly / lttv / modules / guiControlFlow / Drawing.c
index cb2d049d440e828579c7bb97c7ce00b5062cc054..e2225a118ab56c6c8c53e6c62c060dd1f57dd982 100644 (file)
@@ -244,9 +244,7 @@ GtkWidget *Drawing_getWidget(Drawing_t *Drawing)
 
 /* get_time_from_pixels
  *
- * Get the time interval from window time and pixels, and pixels requested. This
- * function uses TimeMul, which should only be used if the float value is lower
- * that 4, and here it's always lower than 1, so it's ok.
+ * Get the time interval from window time and pixels, and pixels requested.
  */
 void convert_pixels_to_time(
                Drawing_t *Drawing,
@@ -257,13 +255,10 @@ void convert_pixels_to_time(
 {
        LttTime window_time_interval;
        
-       TimeSub(window_time_interval, *window_time_end, *window_time_begin);
-
-       
-       TimeMul(*time, window_time_interval,
-                       (x/(float)Drawing->width));
-       TimeAdd(*time, *window_time_begin, *time);
-       
+       window_time_interval = ltt_time_sub(*window_time_end, 
+            *window_time_begin);
+       *time = ltt_time_mul(window_time_interval, (x/(float)Drawing->width));
+       *time = ltt_time_add(*window_time_begin, *time);
 }
 
 
@@ -278,14 +273,12 @@ void convert_time_to_pixels(
        LttTime window_time_interval;
        float interval_float, time_float;
        
-       TimeSub(window_time_interval, window_time_end, window_time_begin);
+       window_time_interval = ltt_time_sub(window_time_end,window_time_begin);
        
-       TimeSub(time, time, window_time_begin);
+       time = ltt_time_sub(time, window_time_begin);
        
-       interval_float = (window_time_interval.tv_sec * NANSECOND_CONST)
-                       + window_time_interval.tv_nsec;
-       time_float = (time.tv_sec * NANSECOND_CONST)
-                       + time.tv_nsec;
+       interval_float = ltt_time_to_double(window_time_interval);
+       time_float = ltt_time_to_double(time);
 
        *x = (guint)(time_float/interval_float * Drawing->width);
        
This page took 0.023677 seconds and 4 git commands to generate.