comparison layer/Colour3DPlotLayer.cpp @ 457:e75f15c9ea11

* Fix failure to include audio files in default open-file dialog invoked from toolbar button! * Some adjustments to vertical scale presentation in colour 3d plot with a lot of vertical bins
author Chris Cannam
date Wed, 03 Dec 2008 16:25:47 +0000
parents 035d62c4cddf
children 272e58f0bf8b
comparison
equal deleted inserted replaced
456:035d62c4cddf 457:e75f15c9ea11
557 557
558 paint.save(); 558 paint.save();
559 559
560 QFont tf = paint.font(); 560 QFont tf = paint.font();
561 if (paint.fontMetrics().height() >= binHeight) { 561 if (paint.fontMetrics().height() >= binHeight) {
562 tf.setPixelSize(binHeight > 4 ? binHeight - 2 : 2); 562 tf.setPixelSize(binHeight > 7 ? binHeight - 2 : 5);
563 paint.setFont(tf); 563 paint.setFont(tf);
564 } 564 }
565 565
566 int count = v->height() / paint.fontMetrics().height(); 566 int count = v->height() / paint.fontMetrics().height();
567 int step = (symax - symin) / count; 567 int step = (symax - symin) / count;
578 578
579 QString text = m_model->getBinName(idx); 579 QString text = m_model->getBinName(idx);
580 if (text == "") text = QString("[%1]").arg(idx + 1); 580 if (text == "") text = QString("[%1]").arg(idx + 1);
581 581
582 paint.drawLine(cw, y0, w, y0); 582 paint.drawLine(cw, y0, w, y0);
583
584 if (step > 1) {
585 paint.drawLine(w - 1, y0 - (step * binHeight) + 1,
586 w - 1, y0 - binHeight - 1);
587 paint.drawLine(w - 2, y0 - (step * binHeight) + 1,
588 w - 2, y0 - binHeight - 2);
589 }
583 590
584 int cy = int(y0 - (step * binHeight)/2); 591 int cy = int(y0 - (step * binHeight)/2);
585 int ty = cy + paint.fontMetrics().ascent()/2; 592 int ty = cy + paint.fontMetrics().ascent()/2;
586 593
587 paint.drawText(cw + 5, ty, text); 594 paint.drawText(cw + 5, ty, text);