- if( t < start ){
- adj_timescale->set_lower(t);
- adj_timescale->set_upper(t+end-start);
- } else if( t > end ){
- adj_timescale->set_upper(t);
- adj_timescale->set_lower(t-end+start);
+ // don't go past the start of time
+ if (t < lower)
+ t = lower;
+
+ // if we are already in the left half of the slider
+ if ((t-start)*2 < (end-start))
+ {
+ // if we can't scroll the background right one whole tick, scroll it to the beginning
+ if (start < lower + (orig_t-t))
+ {
+ adj_timescale->set_lower(lower);
+ adj_timescale->set_upper(lower + (end-start));
+ }
+ // else scroll the background right
+ else
+ {
+ adj_timescale->set_lower(start - (orig_t-t));
+ adj_timescale->set_upper(start - (orig_t-t) + (end-start));
+ }
+ }