From e8ac0b4d97b10e7e78bc23b34dddc32a460d7bb5 Mon Sep 17 00:00:00 2001 From: EvanR Date: Mon, 5 Jan 2009 01:27:11 -0600 Subject: [PATCH] Fixed timeline drawing problem at extreme range. The problem was that giving fltk drawing commands that are very far negative will have the effect of wrapping around. Fixed by not giving coordinates that are very large negative. --- src/arranger.cpp | 2 -- src/timeline.cpp | 56 ++++++++++++++++++++++++++++++++++---------------------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/src/arranger.cpp b/src/arranger.cpp index 0fdc200..45de7da 100644 --- a/src/arranger.cpp +++ b/src/arranger.cpp @@ -696,13 +696,11 @@ void Arranger::update(int pos){ int kludge=2; void Arranger::layout(){ -printf("ok\n"); if(kludge!=0){ kludge--; return; } fakeh = tracks.size()*30; -printf("%d\n",tracks.size()); if(fakeh=0){ + fltk::fillrect(I,h()/2,1,h()/2); + } } fltk::setcolor(fltk::BLACK); @@ -125,9 +127,11 @@ void Timeline::draw(){ I=0; for(int i=0; I=0){ + fltk::fillrect(I,0,1,h()/2); + sprintf(buf,"%u",j*label_scale); + fltk::drawtext(buf,I+3,h()-3); + } j++; } @@ -139,7 +143,9 @@ void Timeline::draw(){ int I=0; for(int i=0; I=0){ + fltk::fillrect(I,h()/2,1,h()/2); + } } fltk::setcolor(fltk::BLACK); @@ -151,31 +157,37 @@ void Timeline::draw(){ I=0; for(int i=0; I=0){ + fltk::fillrect(I,0,1,h()/2); + sprintf(buf,"%u",j*label_scale*p/4); + fltk::drawtext(buf,I+3,h()-3); + } j++; } } int X = tick2xpix(get_loop_start()*4/scale); - fltk::setcolor(fltk::color(0,0,255)); - fillrect(X+0,0,1,h()-1); - fltk::setcolor(fltk::color(85,85,255)); - fillrect(X+1,0,1,h()-1); - fltk::setcolor(fltk::color(170,170,255)); - fillrect(X+2,0,1,h()-1); + if(X >= -10){ + fltk::setcolor(fltk::color(0,0,255)); + fillrect(X+0,0,1,h()-1); + fltk::setcolor(fltk::color(85,85,255)); + fillrect(X+1,0,1,h()-1); + fltk::setcolor(fltk::color(170,170,255)); + fillrect(X+2,0,1,h()-1); + } X = tick2xpix(get_loop_end()*4/scale); - fltk::setcolor(fltk::color(128,0,0)); - fillrect(X+0,0,1,h()-1); - fltk::setcolor(fltk::color(170,42,42)); - fillrect(X-1,0,1,h()-1); - fltk::setcolor(fltk::color(255,170,170)); - fillrect(X-2,0,1,h()-1); - - if(hand){ + if(X >= -10){ + fltk::setcolor(fltk::color(128,0,0)); + fillrect(X+0,0,1,h()-1); + fltk::setcolor(fltk::color(170,42,42)); + fillrect(X-1,0,1,h()-1); + fltk::setcolor(fltk::color(255,170,170)); + fillrect(X-2,0,1,h()-1); + } + + if(hand && pointer_x*4/scale-scroll-10 >= -20){ hand->draw(pointer_x*4/scale-scroll-10,h()-19); } -- 2.11.4.GIT