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:
authorCampbell Barton <ideasman42@gmail.com>2011-08-05 14:45:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-08-05 14:45:32 +0400
commita157112ac5c6465fd8d9518af87ce86a5250eeba (patch)
treea6453aca7729621156b84d7189d97d7ae1cd6aee /source/blender/editors/include
parentad7ea2f89205dd67b84ec76d70352ad56004293a (diff)
fix for icon scaling with the DPI setting
- icons were scaling by the sqrt(dpi)/8.48528, but infact they only need to be scaled by (dpi/72). - UI_icon_get_width value was being used without multiplying by dpi scale.
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r--source/blender/editors/include/UI_interface.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 61e19655f8d..1bae6ce0214 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -164,6 +164,9 @@ typedef struct uiLayout uiLayout;
/* scale fixed button widths by this to account for DPI
* 8.4852 == sqrtf(72.0f)) */
#define UI_DPI_FAC (sqrtf((float)U.dpi) / 8.48528137423857f)
+#define UI_DPI_ICON_FAC (((float)U.dpi) / 72.0f)
+/* 16 to copy ICON_DEFAULT_HEIGHT */
+#define UI_DPI_ICON_SIZE ((float)16 * UI_DPI_ICON_FAC)
/* Button types, bits stored in 1 value... and a short even!
- bits 0-4: bitnr (0-31)