From f5f19db5a97daf2cf02770b4af739111b83f42b8 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Wed, 20 Feb 2008 04:55:35 -0600 Subject: [PATCH] Fix label offset when scrolling... This is necessary if we want to support fl_scroll optimization. --- Region.C | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Region.C b/Region.C index 5d9d8d4..1efa029 100644 --- a/Region.C +++ b/Region.C @@ -347,11 +347,12 @@ Region::draw ( int X, int Y, int W, int H ) int bw = Fl::box_dw( FL_PLASTIC_UP_BOX ); int bh = Fl::box_dh( FL_PLASTIC_UP_BOX ); - Fl_Align align = (Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_BOTTOM | FL_ALIGN_CLIP); - fl_draw( _clip->name(), bx + rx + 1, Y + 1 + by, rw - bw, H - bh, align ); - fl_color( FL_WHITE ); - fl_draw( _clip->name(), bx + rx, Y + by , rw - bw, H - bh, align ); + int dx = min( 32767, timeline.ts_to_x( offset ) ); + Fl_Align align = (Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_BOTTOM | FL_ALIGN_CLIP); + fl_draw( _clip->name(), (bx + rx + 1) - dx, Y + 1 + by, rw - bw, H - bh, align ); + fl_color( FL_WHITE ); + fl_draw( _clip->name(), (bx + rx) - dx, Y + by , rw - bw, H - bh, align ); // fl_draw( _clip->name(), X, Y );