[Bf-blender-cvs] [73b19bfb275] blender2.8: UI: fix enum icon buttons haveing different size.

Harley Acheson noreply at git.blender.org
Tue Dec 11 20:47:25 CET 2018


Commit: 73b19bfb2756ff562eb936f5a1a30172e85fca6c
Author: Harley Acheson
Date:   Tue Dec 11 11:23:13 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB73b19bfb2756ff562eb936f5a1a30172e85fca6c

UI: fix enum icon buttons haveing different size.

The alignment makes it so the button edges overlap, now one pixel is removed
to account for this.

Differential Revision: https://developer.blender.org/D4063

===================================================================

M	source/blender/editors/interface/interface_layout.c

===================================================================

diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 8a27fd55d37..c0706ed8450 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -721,7 +721,7 @@ static void ui_item_enum_expand_exec(
 		if (icon && name[0] && !icon_only)
 			but = uiDefIconTextButR_prop(block, but_type, 0, icon, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
 		else if (icon)
-			but = uiDefIconButR_prop(block, but_type, 0, icon, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
+			but = uiDefIconButR_prop(block, but_type, 0, icon, 0, 0, (is_first) ? itemw : itemw - UI_DPI_FAC, h, ptr, prop, -1, 0, value, -1, -1, NULL);
 		else
 			but = uiDefButR_prop(block, but_type, 0, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);



More information about the Bf-blender-cvs mailing list