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:
authorHarley Acheson <harley>2019-02-21 19:34:48 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-02-21 20:03:34 +0300
commit1de1cedf4c2fe3dc460267ea3134f17df508b7d9 (patch)
treeb0d89c5e72b62015f9e40309ff4bd0b8a3271371 /source/blender/windowmanager/intern/wm_window.c
parent86bbadaaee949f39f28436ff65c65ae6b194a3c3 (diff)
UI: better widget drawing with thick line width.
When the line width was larger than the UI scale, there was not enough space for thicker widget outlines to draw properly. Now widgets are made a little larger to accommodate the thicker outlines. Differential Revision: https://developer.blender.org/D4368
Diffstat (limited to 'source/blender/windowmanager/intern/wm_window.c')
-rw-r--r--source/blender/windowmanager/intern/wm_window.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 4fc4e391b8a..c432dce0757 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -603,9 +603,13 @@ void WM_window_set_dpi(wmWindow *win)
U.pixelsize = pixelsize;
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);
+ /* Set user preferences globals for drawing, and for forward compatibility. */
+ U.widget_unit = (U.pixelsize * U.dpi * 20 + 36) / 72;
+ /* If line thickness differs from scaling factor then adjustments need to be made */
+ U.widget_unit += 2 * ((int)U.pixelsize - (int)U.dpi_fac);
+
/* update font drawing */
BLF_default_dpi(U.pixelsize * U.dpi);
}