[Bf-blender-cvs] [a28adf1] master: Some more minor cleanup in new icon preview code.

Bastien Montagne noreply at git.blender.org
Sun May 24 16:51:01 CEST 2015


Commit: a28adf1b356e0431665ebe9998e3baa133c18ef9
Author: Bastien Montagne
Date:   Sun May 24 16:50:15 2015 +0200
Branches: master
https://developer.blender.org/rBa28adf1b356e0431665ebe9998e3baa133c18ef9

Some more minor cleanup in new icon preview code.

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

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

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

diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index adf0fdf..1920250 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1663,13 +1663,9 @@ static uiBlock *ui_icon_view_menu_cb(bContext *C, ARegion *ar, void *arg_litem)
 
 	for (a = 0; item[a].identifier; a++) {
 		int x, y;
-		/* XXX hardcoded size to 5 x unit */
-		int w = UI_UNIT_X * 5;
-		int h = UI_UNIT_Y * 5;
-
-		if (args.show_labels) {
-			h += (int)(1.25f * UI_UNIT_Y);
-		}
+		/* XXX hardcoded size to 5 units */
+		const int w = UI_UNIT_X * 5;
+		const int h = args.show_labels ? (int)(6.25f * UI_UNIT_Y) : UI_UNIT_Y * 5;
 
 		x = (a % 8) * w;
 		y = (a / 8) * h;




More information about the Bf-blender-cvs mailing list