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:
authorLeon Leno <lone_noel>2021-04-07 17:41:36 +0300
committerNathan Craddock <nzcraddock@gmail.com>2021-04-07 17:54:05 +0300
commit965425bcbc4dd8340286b83bccfa17e99792f594 (patch)
tree08db73f58d9872b58beee58d8dbe423fac70c8b7 /source/blender/editors/interface/interface_icons.c
parent02a7289fe3c8451af9a86e4518106e6a66f82070 (diff)
Fix T86463: Colored collection icons don't scale with zoom level
This patch fixes the issue in T86463 that colored collection icons in the collection search box don't scale according to the zoom level. The issue was caused by the drawing function for the colored collection icons not allowing to change the size of the icons. This patch addresses that by scaling the icon based on the drawing width. Reviewed By: #user_interface, natecraddock, Severin Differential Revision: https://developer.blender.org/D10708
Diffstat (limited to 'source/blender/editors/interface/interface_icons.c')
-rw-r--r--source/blender/editors/interface/interface_icons.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index c16c3d2c49a..225b1b36ac3 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -457,13 +457,15 @@ DEF_ICON_VECTOR_COLORSET_DRAW_NTH(20, 19)
# undef DEF_ICON_VECTOR_COLORSET_DRAW_NTH
static void vicon_collection_color_draw(
- short color_tag, int x, int y, int UNUSED(w), int UNUSED(h), float UNUSED(alpha))
+ short color_tag, int x, int y, int w, int UNUSED(h), float UNUSED(alpha))
{
bTheme *btheme = UI_GetTheme();
const ThemeCollectionColor *collection_color = &btheme->collection_color[color_tag];
+ const float aspect = (float)ICON_DEFAULT_WIDTH / (float)w;
+
UI_icon_draw_ex(
- x, y, ICON_OUTLINER_COLLECTION, U.inv_dpi_fac, 1.0f, 0.0f, collection_color->color, true);
+ x, y, ICON_OUTLINER_COLLECTION, aspect, 1.0f, 0.0f, collection_color->color, true);
}
# define DEF_ICON_COLLECTION_COLOR_DRAW(index, color) \