X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Fdrawing.c;h=aaf8b03005d0b47d0ac6600a745db1ef50f717c9;hb=c74e0cf9bdbda21d13d48be89bc9fd3e257c9b9e;hp=01d4260dbd24966f640b4c912747f7cd50267df7;hpb=f31675494449c73316cab60617f51a85e67291c1;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c index 01d4260d..aaf8b030 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c @@ -935,13 +935,13 @@ __inline void convert_pixels_to_time( LttTime *time) { LttTime window_time_interval; - guint64 time_ll; + double time_d; window_time_interval = ltt_time_sub(window_time_end, window_time_begin); - time_ll = ltt_time_to_uint64(window_time_interval); - time_ll = time_ll * x / width; - *time = ltt_time_from_uint64(time_ll); + time_d = ltt_time_to_double(window_time_interval); + time_d = time_d / (double)width * (double)x; + *time = ltt_time_from_double(time_d); *time = ltt_time_add(window_time_begin, *time); } @@ -954,23 +954,23 @@ __inline void convert_time_to_pixels( guint *x) { LttTime window_time_interval; - guint64 time_ll, interval_ll; - + 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); - time_ll = ltt_time_to_uint64(time); - interval_ll = ltt_time_to_uint64(window_time_interval); + time_d = ltt_time_to_double(time); + interval_d = ltt_time_to_double(window_time_interval); - if(interval_ll == 0) { - g_assert(time_ll == 0); + if(interval_d == 0.0) { + g_assert(time_d == 0.0); *x = 0; } else { - *x = (guint)(time_ll * width / interval_ll); + *x = (guint)(time_d / interval_d * (double)width); } }