comparison layer/RegionLayer.cpp @ 1077:5144d7185fb5 spectrogram-minor-refactor

Move LayerGeometryProvider from view to layer
author Chris Cannam
date Thu, 30 Jun 2016 10:59:11 +0100
parents 2adca8f05583
children ee01a4062747
comparison
equal deleted inserted replaced
1076:e536dfc6b250 1077:5144d7185fb5
981 QString vlabel = QString("%1%2").arg(p.value).arg(getScaleUnits()); 981 QString vlabel = QString("%1%2").arg(p.value).arg(getScaleUnits());
982 v->drawVisibleText(paint, 982 v->drawVisibleText(paint,
983 x - paint.fontMetrics().width(vlabel) - 2, 983 x - paint.fontMetrics().width(vlabel) - 2,
984 y + paint.fontMetrics().height()/2 984 y + paint.fontMetrics().height()/2
985 - paint.fontMetrics().descent(), 985 - paint.fontMetrics().descent(),
986 vlabel, View::OutlinedText); 986 vlabel, LayerGeometryProvider::OutlinedText);
987 987
988 QString hlabel = RealTime::frame2RealTime 988 QString hlabel = RealTime::frame2RealTime
989 (p.frame, m_model->getSampleRate()).toText(true).c_str(); 989 (p.frame, m_model->getSampleRate()).toText(true).c_str();
990 v->drawVisibleText(paint, 990 v->drawVisibleText(paint,
991 x, 991 x,
992 y - h/2 - paint.fontMetrics().descent() - 2, 992 y - h/2 - paint.fontMetrics().descent() - 2,
993 hlabel, View::OutlinedText); 993 hlabel, LayerGeometryProvider::OutlinedText);
994 } 994 }
995 995
996 paint.drawLine(x, y-1, x + w, y-1); 996 paint.drawLine(x, y-1, x + w, y-1);
997 paint.drawLine(x, y+1, x + w, y+1); 997 paint.drawLine(x, y+1, x + w, y+1);
998 paint.drawLine(x, y - h/2, x, y + h/2); 998 paint.drawLine(x, y - h/2, x, y + h/2);
1046 } 1046 }
1047 lastLabelY = labelY; 1047 lastLabelY = labelY;
1048 nextLabelMinX = labelX + paint.fontMetrics().width(label); 1048 nextLabelMinX = labelX + paint.fontMetrics().width(label);
1049 } 1049 }
1050 1050
1051 v->drawVisibleText(paint, labelX, labelY, label, View::OutlinedText); 1051 v->drawVisibleText(paint, labelX, labelY, label, LayerGeometryProvider::OutlinedText);
1052 } 1052 }
1053 } 1053 }
1054 1054
1055 paint.restore(); 1055 paint.restore();
1056 } 1056 }