[Bf-blender-cvs] [4570d44c4ed] custom-manipulators: Fix node backdrop manipulator

Campbell Barton noreply at git.blender.org
Mon May 29 07:19:29 CEST 2017


Commit: 4570d44c4edec29e4ed4fb1574ce947c4d76fdae
Author: Campbell Barton
Date:   Mon May 29 15:17:31 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rB4570d44c4edec29e4ed4fb1574ce947c4d76fdae

Fix node backdrop manipulator

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

M	source/blender/editors/space_node/node_draw.c
M	source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c

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

diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 582e659c8fc..4fc9f08ff02 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -1396,20 +1396,21 @@ void drawnodespace(const bContext *C, ARegion *ar)
 			/* backdrop */
 			draw_nodespace_back_pix(C, ar, snode, path->parent_key);
 
-			glMatrixMode(GL_PROJECTION);
-			glPushMatrix();
-			glMatrixMode(GL_MODELVIEW);
-			glPushMatrix();
-			
-			glaDefine2DArea(&ar->winrct);
-			wmOrtho2_pixelspace(ar->winx, ar->winy);
+			{
+				float original_proj[4][4];
+				gpuGetProjectionMatrix(original_proj);
+
+				gpuPushMatrix();
+				gpuLoadIdentity();
 
-			WM_manipulatormap_draw(ar->manipulator_map, C, WM_MANIPULATORMAP_DRAWSTEP_2D);
+				glaDefine2DArea(&ar->winrct);
+				wmOrtho2_pixelspace(ar->winx, ar->winy);
 
-			glMatrixMode(GL_PROJECTION);
-			glPopMatrix();
-			glMatrixMode(GL_MODELVIEW);
-			glPopMatrix();
+				WM_manipulatormap_draw(ar->manipulator_map, C, WM_MANIPULATORMAP_DRAWSTEP_2D);
+
+				gpuPopMatrix();
+				gpuLoadProjectionMatrix(original_proj);
+			}
 
 			draw_nodetree(C, ar, ntree, path->parent_key);
 		}
diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c
index 59ae06eb30b..45973fbf2fe 100644
--- a/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c
@@ -179,7 +179,7 @@ static void rect_transform_draw_interaction(
 	VertexFormat *format = immVertexFormat();
 	unsigned int pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT);
 	unsigned int color = VertexFormat_add_attrib(format, "color", COMP_F32, 3, KEEP_FLOAT);
-	immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
+	immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
 
 	glLineWidth(line_width + 3.0);
 
@@ -198,6 +198,8 @@ static void rect_transform_draw_interaction(
 	immVertex2fv(pos, verts[1]);
 	immVertex2fv(pos, verts[2]);
 	immEnd();
+
+	immUnbindProgram();
 }
 
 static void manipulator_rect_transform_draw(const bContext *UNUSED(C), wmManipulator *manipulator)




More information about the Bf-blender-cvs mailing list