Mercurial > hg > svgui
comparison layer/TimeValueLayer.cpp @ 607:5b72899d692b
Give a dedicated key to toggling the centre line, and move it out of the overlay level setting -- reducing number of overlay levels to 3. Introduce two distinct vertical scale types (so that we can hide the spectrogram colour scale part easily)
author | Chris Cannam |
---|---|
date | Mon, 30 Jan 2012 16:01:59 +0000 |
parents | 4806715f7a19 |
children | 156a120345ae |
comparison
equal
deleted
inserted
replaced
606:fbab21439115 | 607:5b72899d692b |
---|---|
1104 // looks like save/restore doesn't deal with this: | 1104 // looks like save/restore doesn't deal with this: |
1105 paint.setRenderHint(QPainter::Antialiasing, false); | 1105 paint.setRenderHint(QPainter::Antialiasing, false); |
1106 } | 1106 } |
1107 | 1107 |
1108 int | 1108 int |
1109 TimeValueLayer::getVerticalScaleWidth(View *, QPainter &paint) const | 1109 TimeValueLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const |
1110 { | 1110 { |
1111 int w = paint.fontMetrics().width("-000.000"); | 1111 int w = paint.fontMetrics().width("-000.000"); |
1112 if (m_plotStyle == PlotSegmentation) return w + 20; | 1112 if (m_plotStyle == PlotSegmentation) return w + 20; |
1113 else return w + 10; | 1113 else return w + 10; |
1114 } | 1114 } |
1115 | 1115 |
1116 void | 1116 void |
1117 TimeValueLayer::paintVerticalScale(View *v, QPainter &paint, QRect) const | 1117 TimeValueLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const |
1118 { | 1118 { |
1119 if (!m_model) return; | 1119 if (!m_model) return; |
1120 | 1120 |
1121 int h = v->height(); | 1121 int h = v->height(); |
1122 | 1122 |
1137 float val = min; | 1137 float val = min; |
1138 float inc = (max - val) / n; | 1138 float inc = (max - val) / n; |
1139 | 1139 |
1140 char buffer[40]; | 1140 char buffer[40]; |
1141 | 1141 |
1142 int w = getVerticalScaleWidth(v, paint); | 1142 int w = getVerticalScaleWidth(v, false, paint); |
1143 | 1143 |
1144 int tx = 5; | 1144 int tx = 5; |
1145 | 1145 |
1146 int boxx = 5, boxy = 5; | 1146 int boxx = 5, boxy = 5; |
1147 if (m_model->getScaleUnits() != "") { | 1147 if (m_model->getScaleUnits() != "") { |