History

Cleanup dpi scaling comments

Ryan Huffman committed 11 years ago

Commit a8999961 parent 47519742 files · +3 −17Browse files

Showing the changes to interface/src/UIUtil.cpp (1 of 2 files). Show all

Unified · Split

interface/src/UIUtil.cpp+3−11
@@ -33,9 +33,8 @@ int UIUtil::getWindowTitleBarHeight(const QWidget* window) { · 32 unmodified lines
3333
3434 // When setting the font size of a widget in points, the rendered text will be larger
3535 // on Windows and Linux than on Mac OSX. This is because Windows and Linux use a DPI
36−// of 96, while OSX uses 72.
37−// In order to get consistent results across platforms, the font sizes need to be scaled
38−// based on the system DPI.
36+// of 96, while OSX uses 72. In order to get consistent results across platforms, the
37+// font sizes need to be scaled based on the system DPI.
3938 // This function will scale the font size of widget and all
4039 // of its children recursively.
4140 void UIUtil::scaleWidgetFontSizes(QWidget* widget) {
@@ -53,14 +52,7 @@ void UIUtil::scaleWidgetFontSizes(QWidget* widget) { · 11 unmodified lines
5352
5453 // Scale fonts based on the native dpi. On Windows, where the native DPI is 96,
5554 // the scale will be: 72.0 / 96.0 = 0.75
56− float fontScale = (BASE_DPI / NATIVE_DPI);
57−
58− // Scale the font further by the system's DPI settings. If using a 2x high-dpi screen
59− // on Windows, for example, the font will be further scaled by: 192.0 / 96.0 = 2.0
60− // This would give a final scale of: 0.75 * 2.0 = 1.5
61− // fontScale *= (glCanvas->logicalDpiX() / NATIVE_DPI);
62−
63− qDebug() << "Scaling widgets by: " << fontScale;
55+ float fontScale = BASE_DPI / NATIVE_DPI;
6456
6557 internalScaleWidgetFontSizes(widget, fontScale);
6658 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t