comparison view/View.cpp @ 283:86a112b5b319

* Make it possible to "measure" a feature on the spectrogram by double- clicking in measure mode * Make shift-click-drag (for zoom to region) work in measure mode as well as navigate mode. It would be nice to be able to shift-doubleclick to zoom on a feature directly using a combination of these last two features, but that isn't possible yet. * Make Del delete the measurement under the mouse pointer.
author Chris Cannam
date Thu, 05 Jul 2007 15:36:37 +0000
parents 47fe0352861e
children cd2492c5fe45
comparison
equal deleted inserted replaced
282:4edaff85875d 283:86a112b5b319
1735 } 1735 }
1736 bw = paint.fontMetrics().width(bxs); 1736 bw = paint.fontMetrics().width(bxs);
1737 } 1737 }
1738 } 1738 }
1739 1739
1740 if (b0 && b1 && u0 == u1) { 1740 if (b0 && b1 && v1 != v0 && u0 == u1) {
1741 dxs = QString("(%1 %2)").arg(fabs(v1 - v0)).arg(u1); 1741 dxs = QString("(%1 %2)").arg(fabs(v1 - v0)).arg(u1);
1742 dw = paint.fontMetrics().width(dxs); 1742 dw = paint.fontMetrics().width(dxs);
1743 } 1743 }
1744 1744
1745 b0 = false; 1745 b0 = false;
1769 bool bd = false; 1769 bool bd = false;
1770 float dy = 0.f; 1770 float dy = 0.f;
1771 QString du; 1771 QString du;
1772 1772
1773 if ((bd = topLayer->getYScaleDifference(this, r.y(), r.y() + r.height(), 1773 if ((bd = topLayer->getYScaleDifference(this, r.y(), r.y() + r.height(),
1774 dy, du))) { 1774 dy, du)) &&
1775 dy != 0) {
1775 if (du != "") { 1776 if (du != "") {
1776 dys = QString("(%1 %2)").arg(dy).arg(du); 1777 dys = QString("(%1 %2)").arg(dy).arg(du);
1777 } else { 1778 } else {
1778 dys = QString("(%1)").arg(dy); 1779 dys = QString("(%1)").arg(dy);
1779 } 1780 }