[Bf-blender-cvs] [d591f31] master: Fix T37705: texture panel order wrong when switching from cycles to blender render.

Brecht Van Lommel noreply at git.blender.org
Wed Dec 18 13:16:05 CET 2013


Commit: d591f314f9a3dc1a0d16b9061f63373ff611dc24
Author: Brecht Van Lommel
Date:   Wed Dec 18 13:15:13 2013 +0100
http://developer.blender.org/rBd591f314f9a3dc1a0d16b9061f63373ff611dc24

Fix T37705: texture panel order wrong when switching from cycles to blender render.

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

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

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

diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index be6cbaf..76d222f 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -267,6 +267,11 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, Pan
 		}
 	}
 
+	/* ensure panels without header are at the top */
+	if (pt->flag & PNL_NO_HEADER) {
+		pa->sortorder = 0;
+	}
+
 	/* Do not allow closed panels without headers! Else user could get "disappeared" UI! */
 	if ((pt->flag & PNL_NO_HEADER) && (pa->flag & PNL_CLOSED)) {
 		pa->flag &= ~PNL_CLOSED;
@@ -285,7 +290,16 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, Pan
 			break;
 	
 	if (newpanel) {
-		pa->sortorder = (palast) ? palast->sortorder + 1 : 0;
+		if (palast) {
+			pa->sortorder = palast->sortorder + 1;
+		}
+		else {
+			pa->sortorder = 0;
+
+			for (palast = ar->panels.first; palast; palast = palast->next)
+				if (pa->sortorder <= palast->sortorder)
+					pa->sortorder = palast->sortorder + 1;
+		}
 
 		for (panext = ar->panels.first; panext; panext = panext->next)
 			if (panext != pa && panext->sortorder >= pa->sortorder)
@@ -1002,7 +1016,6 @@ void uiScalePanels(ARegion *ar, float new_width)
 	for (block = ar->uiblocks.first; block; block = block->next) {
 		if (block->panel) {
 			float fac = new_width / (float)block->panel->sizex;
-			printf("scaled %f\n", fac);
 			block->panel->sizex = new_width;
 			
 			for (but = block->buttons.first; but; but = but->next) {




More information about the Bf-blender-cvs mailing list