Mercurial > hg > svgui
comparison view/Pane.cpp @ 1390:3c99083a4d83 spectrogramparam
Move layer name text up a bit when rendering on a layer with a horizontal scale (i.e. spectrum)
author | Chris Cannam |
---|---|
date | Tue, 13 Nov 2018 14:48:42 +0000 |
parents | 1eb560b363e7 |
children | c39f2d439d59 |
comparison
equal
deleted
inserted
replaced
1389:1eb560b363e7 | 1390:3c99083a4d83 |
---|---|
879 } | 879 } |
880 | 880 |
881 void | 881 void |
882 Pane::drawLayerNames(QRect r, QPainter &paint) | 882 Pane::drawLayerNames(QRect r, QPainter &paint) |
883 { | 883 { |
884 ViewProxy proxy(this, effectiveDevicePixelRatio()); | |
885 | |
884 int fontHeight = paint.fontMetrics().height(); | 886 int fontHeight = paint.fontMetrics().height(); |
885 int fontAscent = paint.fontMetrics().ascent(); | 887 int fontAscent = paint.fontMetrics().ascent(); |
886 | 888 |
887 int lly = height() - 6; | 889 int lly = height() - 6; |
888 if (m_manager->getZoomWheelsEnabled()) { | 890 if (m_manager->getZoomWheelsEnabled()) { |
889 lly -= m_manager->scalePixelSize(20); | 891 lly -= m_manager->scalePixelSize(20); |
890 } | 892 } |
891 | 893 |
894 for (LayerList::iterator i = m_layerStack.end(); i != m_layerStack.begin();) { | |
895 --i; | |
896 int hsh = (*i)->getHorizontalScaleHeight(&proxy, paint); | |
897 if (hsh > 0) { | |
898 lly -= hsh; | |
899 break; | |
900 } | |
901 if ((*i)->isLayerOpaque()) { | |
902 break; | |
903 } | |
904 } | |
905 | |
892 if (r.y() + r.height() < lly - int(m_layerStack.size()) * fontHeight) { | 906 if (r.y() + r.height() < lly - int(m_layerStack.size()) * fontHeight) { |
893 return; | 907 return; |
894 } | 908 } |
895 | 909 |
896 QStringList texts; | 910 QStringList texts; |