[Bf-blender-cvs] [288892bf08f] blender2.8: Make UI block drawing closer to master

Sergey Sharybin noreply at git.blender.org
Wed Apr 19 15:23:07 CEST 2017


Commit: 288892bf08f380afdfe7f2f8f5b1ca2d2e037fe3
Author: Sergey Sharybin
Date:   Wed Apr 19 10:26:40 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB288892bf08f380afdfe7f2f8f5b1ca2d2e037fe3

Make UI block drawing closer to master

There is no need to break assumptions of what's being modified
by this call and what's restored. The changes in this function
simply spread crappyness outside of the UI block.

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

M	source/blender/editors/interface/interface.c
M	source/blender/editors/space_node/node_draw.c

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

diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index bc7f835390c..365ebfc17c4 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1377,6 +1377,9 @@ void UI_block_draw(const bContext *C, uiBlock *block)
 	ui_but_to_pixelrect(&rect, ar, block, NULL);
 	
 	/* pixel space for AA widgets */
+	glMatrixMode(GL_PROJECTION);
+	gpuPushProjectionMatrix();
+	glMatrixMode(GL_MODELVIEW);
 	gpuPushMatrix();
 	gpuLoadIdentity();
 
@@ -1402,7 +1405,10 @@ void UI_block_draw(const bContext *C, uiBlock *block)
 		}
 	}
 	
-	/* restore model-view matrix */
+	/* restore matrix */
+	glMatrixMode(GL_PROJECTION);
+	gpuPopProjectionMatrix();
+	glMatrixMode(GL_MODELVIEW);
 	gpuPopMatrix();
 
 	if (multisample_enabled)
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index f80d47b1974..42cb2463651 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -1188,20 +1188,10 @@ void node_set_cursor(wmWindow *win, SpaceNode *snode, float cursor[2])
 
 void node_draw_default(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node, bNodeInstanceKey key)
 {
-	glMatrixMode(GL_PROJECTION);
-	gpuPushProjectionMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	gpuPushMatrix();
-
 	if (node->flag & NODE_HIDDEN)
 		node_draw_hidden(C, ar, snode, ntree, node, key);
 	else
 		node_draw_basis(C, ar, snode, ntree, node, key);
-
-	glMatrixMode(GL_PROJECTION);
-	gpuPopProjectionMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	gpuPopMatrix();
 }
 
 static void node_update(const bContext *C, bNodeTree *ntree, bNode *node)




More information about the Bf-blender-cvs mailing list