comparison layer/TimeRulerLayer.cpp @ 832:44acc0e5e004

Don't label time zero, it gets cut off by opaque end layer
author Chris Cannam
date Wed, 13 Aug 2014 21:45:59 +0100
parents 1d526ba11a24
children 4a578a360011
comparison
equal deleted inserted replaced
831:831188672987 832:44acc0e5e004
235 235
236 QColor greyColour = getPartialShades(v)[1]; 236 QColor greyColour = getPartialShades(v)[1];
237 237
238 paint.save(); 238 paint.save();
239 239
240 // Do not label time zero - we now overlay an opaque area over
241 // time < 0 which would cut it in half
242 int minlabel = 1; // ms
243
240 while (1) { 244 while (1) {
241 245
242 // frame is used to determine where to draw the lines, so it 246 // frame is used to determine where to draw the lines, so it
243 // needs to correspond to an exact pixel (so that we don't get 247 // needs to correspond to an exact pixel (so that we don't get
244 // a different pixel when scrolling a small amount and 248 // a different pixel when scrolling a small amount and
260 cerr << "X well out of range, ending here" << endl; 264 cerr << "X well out of range, ending here" << endl;
261 #endif 265 #endif
262 break; 266 break;
263 } 267 }
264 268
265 if (x >= rect.x() - 50) { 269 if (x >= rect.x() - 50 && ms >= minlabel) {
266 270
267 RealTime rt = RealTime::fromMilliseconds(ms); 271 RealTime rt = RealTime::fromMilliseconds(ms);
268 272
269 #ifdef DEBUG_TIME_RULER_LAYER 273 #ifdef DEBUG_TIME_RULER_LAYER
270 cerr << "X in range, drawing line here for time " << rt.toText() << endl; 274 cerr << "X in range, drawing line here for time " << rt.toText() << endl;