comparison src/uncommitteditem.cpp @ 682:751b21af6b6f

Work around font mis-hinting when scaled on Windows
author Chris Cannam
date Fri, 07 Dec 2018 14:29:23 +0000
parents ae67ea0af696
children 6bfca8973f79
comparison
equal deleted inserted replaced
681:ac7b40a64109 682:751b21af6b6f
128 float scale = std::min(t.m11(), t.m22()); 128 float scale = std::min(t.m11(), t.m22());
129 if (scale > 1.0) { 129 if (scale > 1.0) {
130 int ps = int((f.pixelSize() / scale) + 0.5); 130 int ps = int((f.pixelSize() / scale) + 0.5);
131 if (ps < 8) ps = 8; 131 if (ps < 8) ps = 8;
132 f.setPixelSize(ps); 132 f.setPixelSize(ps);
133 #ifdef Q_OS_WIN32
134 f.setHintingPreference(QFont::PreferVerticalHinting);
135 #endif
133 } 136 }
134 137
135 if (scale < 0.1) { 138 if (scale < 0.1) {
136 paint->setPen(QPen(branchColour, 0, Qt::DashLine)); 139 paint->setPen(QPen(branchColour, 0, Qt::DashLine));
137 } else { 140 } else {
195 float scale = std::min(t.m11(), t.m22()); 198 float scale = std::min(t.m11(), t.m22());
196 if (scale > 1.0) { 199 if (scale > 1.0) {
197 int ps = int((f.pixelSize() / scale) + 0.5); 200 int ps = int((f.pixelSize() / scale) + 0.5);
198 if (ps < 8) ps = 8; 201 if (ps < 8) ps = 8;
199 f.setPixelSize(ps); 202 f.setPixelSize(ps);
203 #ifdef Q_OS_WIN32
204 f.setHintingPreference(QFont::PreferVerticalHinting);
205 #endif
200 } 206 }
201 207
202 if (scale < 0.1) { 208 if (scale < 0.1) {
203 paint->setPen(QPen(branchColour, 0, Qt::DashLine)); 209 paint->setPen(QPen(branchColour, 0, Qt::DashLine));
204 } else { 210 } else {