diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-28 21:39:18 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-28 21:49:46 +0300 |
commit | b5d3fcc9f5c80c459cce2b895f3d6091a59d0571 (patch) | |
tree | be348452f2f062e7a4e901f56c108cd61748a4ea /source/blender/windowmanager | |
parent | e87dd9aa006ff8816c5c5258a91061cec299f446 (diff) |
Python/UI: add more convenient API for drawing based on DPI.
system.ui_scale: size multiplier to use when drawing custom UI elements.
system.ui_line_width: suggested line thickness and point size in pixels.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index e0a1f0f14ad..2d94cc1dae7 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -602,6 +602,7 @@ void WM_window_set_dpi(wmWindow *win) U.dpi = dpi / pixelsize; U.virtual_pixel = (pixelsize == 1) ? VIRTUAL_PIXEL_NATIVE : VIRTUAL_PIXEL_DOUBLE; U.widget_unit = (U.pixelsize * U.dpi * 20 + 36) / 72; + U.dpi_fac = ((U.pixelsize * (float)U.dpi) / 72.0f); /* update font drawing */ BLF_default_dpi(U.pixelsize * U.dpi); |