comparison widgets/WidgetScale.h @ 1308:e7c9650e74a7

Never scale down
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 26 Jun 2018 14:36:56 +0100
parents be5e43e2180c
children
comparison
equal deleted inserted replaced
1307:5af5c611f4cb 1308:e7c9650e74a7
41 double em = QFontMetrics(QFont()).height(); 41 double em = QFontMetrics(QFont()).height();
42 ratio = em / baseEm; 42 ratio = em / baseEm;
43 SVDEBUG << "WidgetScale::scalePixelSize: baseEm = " << baseEm 43 SVDEBUG << "WidgetScale::scalePixelSize: baseEm = " << baseEm
44 << ", platform default font height = " << em 44 << ", platform default font height = " << em
45 << ", resulting scale factor = " << ratio << endl; 45 << ", resulting scale factor = " << ratio << endl;
46 if (ratio < 1.0) {
47 SVDEBUG << "WidgetScale::scalePixelSize: rounding up to 1.0"
48 << endl;
49 ratio = 1.0;
50 }
46 } 51 }
47 52
48 int scaled = int(pixels * ratio + 0.5); 53 int scaled = int(pixels * ratio + 0.5);
49 if (pixels != 0 && scaled == 0) scaled = 1; 54 if (pixels != 0 && scaled == 0) scaled = 1;
50 return scaled; 55 return scaled;