comparison layer/TimeInstantLayer.cpp @ 576:a4ba6c96b66d

* Make text labels in time instant layer more apparent (use drawVisibleText) * Fix bug that caused time-instants in segmentation mode to come up white when zoomed far out
author Chris Cannam
date Mon, 25 Oct 2010 21:52:38 +0200
parents 2e8194a30f40
children f4960f8ce798
comparison
equal deleted inserted replaced
575:bb1035a24958 576:a4ba6c96b66d
384 const SparseOneDimensionalModel::Point &p(*i); 384 const SparseOneDimensionalModel::Point &p(*i);
385 SparseOneDimensionalModel::PointList::const_iterator j = i; 385 SparseOneDimensionalModel::PointList::const_iterator j = i;
386 ++j; 386 ++j;
387 387
388 int x = v->getXForFrame(p.frame); 388 int x = v->getXForFrame(p.frame);
389 if (x == prevX && p.frame != illuminateFrame) continue; 389 if (x == prevX && m_plotStyle == PlotInstants &&
390 p.frame != illuminateFrame) continue;
390 391
391 int iw = v->getXForFrame(p.frame + m_model->getResolution()) - x; 392 int iw = v->getXForFrame(p.frame + m_model->getResolution()) - x;
392 if (iw < 2) { 393 if (iw < 2) {
393 if (iw < 1) { 394 if (iw < 1) {
394 iw = 2; 395 iw = 2;
432 if (illuminateFrame != p.frame && 433 if (illuminateFrame != p.frame &&
433 (nx < x + 5 || x >= v->width() - 1)) { 434 (nx < x + 5 || x >= v->width() - 1)) {
434 paint.setPen(Qt::NoPen); 435 paint.setPen(Qt::NoPen);
435 } 436 }
436 437
437 paint.drawRect(x, -1, nx - x, v->height() + 1); 438 paint.drawRect(x, -1, nx - x, v->height() + 1);
438 } 439 }
439 440
440 odd = !odd; 441 odd = !odd;
441 } 442 }
442 443
453 int nx = v->getXForFrame(j->frame); 454 int nx = v->getXForFrame(j->frame);
454 if (nx >= x && nx - x - iw - 3 <= lw) good = false; 455 if (nx >= x && nx - x - iw - 3 <= lw) good = false;
455 } 456 }
456 457
457 if (good) { 458 if (good) {
458 paint.drawText(x + iw + 2, textY, p.label); 459 v->drawVisibleText(paint, x + iw + 2, textY, p.label, View::OutlinedText);
460 // paint.drawText(x + iw + 2, textY, p.label);
459 } 461 }
460 } 462 }
461 463
462 prevX = x; 464 prevX = x;
463 } 465 }