From 9896970ed051b2e59e02f8fe9b34bbfb32a14658 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 1 Apr 2012 18:28:02 -0700 Subject: [PATCH] Timeline: Don't do FL_DAMAGE_SCROLL unless the viewport has actually moved... --- timeline/src/Timeline.C | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/timeline/src/Timeline.C b/timeline/src/Timeline.C index 1a4f7d7..94ca8c1 100644 --- a/timeline/src/Timeline.C +++ b/timeline/src/Timeline.C @@ -988,16 +988,19 @@ Timeline::draw ( void ) else fl_scroll( X, Y, W, H, dx, dy, draw_clip, this ); } - + if ( damage() & FL_DAMAGE_CHILD ) { fl_push_clip( rulers->x(), rulers->y(), rulers->w(), rulers->h() ); update_child( *rulers ); fl_pop_clip(); - fl_push_clip( tracks->x(), rulers->y() + rulers->h(), tracks->w(), h() - rulers->h() - hscroll->h() ); - update_child( *tracks ); - fl_pop_clip(); + if ( ! ( damage() & FL_DAMAGE_SCROLL ) ) + { + fl_push_clip( tracks->x(), rulers->y() + rulers->h(), tracks->w(), h() - rulers->h() - hscroll->h() ); + update_child( *tracks ); + fl_pop_clip(); + } update_child( *hscroll ); update_child( *vscroll ); @@ -1009,8 +1012,6 @@ done: _old_xposition = xoffset; _old_yposition = _yposition; - - } /** draw a single cursor line at /frame/ with color /color/ using symbol routine /symbol/ for the cap */ @@ -1419,7 +1420,10 @@ Timeline::xposition ( int X ) { xoffset = x_to_ts( X ); - damage( FL_DAMAGE_SCROLL ); + int dx = ts_to_x( _old_xposition ) - ts_to_x( xoffset ); + + if ( dx ) + damage( FL_DAMAGE_SCROLL ); } /** set vertical scroll position to absolute pixel coordinate /Y/ */ @@ -1428,7 +1432,10 @@ Timeline::yposition ( int Y ) { _yposition = Y; - damage( FL_DAMAGE_SCROLL ); + int dy = _old_yposition - _yposition; + + if ( dy ) + damage( FL_DAMAGE_SCROLL ); } /** zoom in by one zoom step */