comparison layer/PaintAssistant.cpp @ 1471:f2525e6cbdf1 by-id

More layer updates
author Chris Cannam
date Mon, 01 Jul 2019 14:17:13 +0100
parents 28075cc658c9
children
comparison
equal deleted inserted replaced
1470:696e569ff21b 1471:f2525e6cbdf1
112 bool spaceForLabel = (i == 0 || 112 bool spaceForLabel = (i == 0 ||
113 abs(y - lastLabelledY) >= textHeight - 1); 113 abs(y - lastLabelledY) >= textHeight - 1);
114 114
115 if (spaceForLabel) { 115 if (spaceForLabel) {
116 116
117 // Qt 5.13 deprecates QFontMetrics::width(), but its suggested
118 // replacement (horizontalAdvance) was only added in Qt 5.11
119 // which is too new for us
120 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
121
117 int tx = 3; 122 int tx = 3;
118 if (paint.fontMetrics().width(text) < w - 10) { 123 if (paint.fontMetrics().width(text) < w - 10) {
119 tx = w - 10 - paint.fontMetrics().width(text); 124 tx = w - 10 - paint.fontMetrics().width(text);
120 } 125 }
121 126