# HG changeset patch # User Chris Cannam # Date 1524561354 -3600 # Node ID 61418c1122817bf599987e683d7763c52ea4d136 # Parent 0ded54e94332eb4b356552f868570ba836055a0a Adjust y-coord of text labels to accommodate larger scaled fonts diff -r 0ded54e94332 -r 61418c112281 layer/TimeInstantLayer.cpp --- a/layer/TimeInstantLayer.cpp Mon Apr 23 16:06:27 2018 +0100 +++ b/layer/TimeInstantLayer.cpp Tue Apr 24 10:15:54 2018 +0100 @@ -458,8 +458,10 @@ } if (good) { - PaintAssistant::drawVisibleText(v, paint, x + iw + 2, textY, p.label, PaintAssistant::OutlinedText); -// paint.drawText(x + iw + 2, textY, p.label); + PaintAssistant::drawVisibleText(v, paint, + x + iw + 2, textY, + p.label, + PaintAssistant::OutlinedText); } } diff -r 0ded54e94332 -r 61418c112281 view/View.cpp --- a/view/View.cpp Mon Apr 23 16:06:27 2018 +0100 +++ b/view/View.cpp Tue Apr 24 10:15:54 2018 +0100 @@ -236,11 +236,11 @@ } } - int y = 15 + paint.fontMetrics().ascent(); + int y = ViewManager::scalePixelSize(15) + paint.fontMetrics().ascent(); for (std::map::const_iterator i = sortedLayers.begin(); i != sortedLayers.end(); ++i) { - if (i->second == layer) return y; + if (i->second == layer) break; y += paint.fontMetrics().height(); } diff -r 0ded54e94332 -r 61418c112281 view/ViewManager.cpp --- a/view/ViewManager.cpp Mon Apr 23 16:06:27 2018 +0100 +++ b/view/ViewManager.cpp Tue Apr 24 10:15:54 2018 +0100 @@ -810,7 +810,7 @@ } int scaled = int(pixels * ratio + 0.5); -// cerr << "scaledSize: " << pixels << " -> " << scaled << " at ratio " << ratio << endl; +// SVDEBUG << "scaledSize: " << pixels << " -> " << scaled << " at ratio " << ratio << endl; if (pixels != 0 && scaled == 0) scaled = 1; return scaled; }