Mercurial > hg > svgui
comparison view/View.cpp @ 1273:61418c112281
Adjust y-coord of text labels to accommodate larger scaled fonts
author | Chris Cannam |
---|---|
date | Tue, 24 Apr 2018 10:15:54 +0100 |
parents | 7527701c8076 |
children | 769d7890203b |
comparison
equal
deleted
inserted
replaced
1272:0ded54e94332 | 1273:61418c112281 |
---|---|
234 if ((*i)->needsTextLabelHeight()) { | 234 if ((*i)->needsTextLabelHeight()) { |
235 sortedLayers[getObjectExportId(*i)] = *i; | 235 sortedLayers[getObjectExportId(*i)] = *i; |
236 } | 236 } |
237 } | 237 } |
238 | 238 |
239 int y = 15 + paint.fontMetrics().ascent(); | 239 int y = ViewManager::scalePixelSize(15) + paint.fontMetrics().ascent(); |
240 | 240 |
241 for (std::map<int, Layer *>::const_iterator i = sortedLayers.begin(); | 241 for (std::map<int, Layer *>::const_iterator i = sortedLayers.begin(); |
242 i != sortedLayers.end(); ++i) { | 242 i != sortedLayers.end(); ++i) { |
243 if (i->second == layer) return y; | 243 if (i->second == layer) break; |
244 y += paint.fontMetrics().height(); | 244 y += paint.fontMetrics().height(); |
245 } | 245 } |
246 | 246 |
247 return y; | 247 return y; |
248 } | 248 } |