Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2017-07-17 15:10:57 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2017-07-17 19:31:19 +0300
commit9bbb197d146d87c053d39a0dfdd9db4cffc53c61 (patch)
tree70e4b00172b5f54c6b096ead74085b32acf7eb5a /source/blender/windowmanager
parentd268cad06a5207d63ff10026eeb09fe450282a01 (diff)
Work around small DPI resulting in blurry fonts, clamping auto DPI to minimum 96.
Since we added auto DPI on Linux, on some systems the UI draws smaller than before due to the monitor reporting DPI values like 88. Blender font drawing gives quite blurry results for such slightly smaller DPI, apparently because the builtin font isn't really designed for such small font sizes. As a workaround this clamps the auto DPI to minimum 96, since the main case we are interested in supporting is high DPI displays anyway. Differential Revision: https://developer.blender.org/D2740
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_window.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 8afeb8e7b3d..e7a1643a1ff 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -379,6 +379,11 @@ void WM_window_set_dpi(wmWindow *win)
{
int auto_dpi = GHOST_GetDPIHint(win->ghostwin);
+ /* Clamp auto DPI to 96, since our font/interface drawing does not work well
+ * with lower sizes. The main case we are interested in supporting is higher
+ * DPI. If a smaller UI is desired it is still possible to adjust UI scale. */
+ auto_dpi = MAX2(auto_dpi, 96);
+
/* Lazily init UI scale size, preserving backwards compatibility by
* computing UI scale from ratio of previous DPI and auto DPI */
if (U.ui_scale == 0) {