[Bf-blender-cvs] [29a7ad8b1a7] master: Node UI: scale cross by pixelsize

Campbell Barton noreply at git.blender.org
Wed Sep 13 13:39:18 CEST 2017


Commit: 29a7ad8b1a76735ae7f41566fa3361f18346e5ec
Author: Campbell Barton
Date:   Wed Sep 13 21:46:43 2017 +1000
Branches: master
https://developer.blender.org/rB29a7ad8b1a76735ae7f41566fa3361f18346e5ec

Node UI: scale cross by pixelsize

Draws a little smaller to fit with 2.8x manipulator.

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

M	source/blender/editors/space_node/drawnode.c

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

diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 6185f4afbe2..7ef34669ee2 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -2204,16 +2204,17 @@ static void node_composit_backdrop_viewer(SpaceNode *snode, ImBuf *backdrop, bNo
 	if (node->custom1 == 0) {
 		const float backdropWidth = backdrop->x;
 		const float backdropHeight = backdrop->y;
-		const float cx  = x + snode->zoom * backdropWidth * node->custom3;
+		const float cx = x + snode->zoom * backdropWidth  * node->custom3;
 		const float cy = y + snode->zoom * backdropHeight * node->custom4;
+		const float cross_size = 12 * U.pixelsize;
 
 		glColor3f(1.0, 1.0, 1.0);
 
 		glBegin(GL_LINES);
-		glVertex2f(cx - 25, cy - 25);
-		glVertex2f(cx + 25, cy + 25);
-		glVertex2f(cx + 25, cy - 25);
-		glVertex2f(cx - 25, cy + 25);
+		glVertex2f(cx - cross_size, cy - cross_size);
+		glVertex2f(cx + cross_size, cy + cross_size);
+		glVertex2f(cx + cross_size, cy - cross_size);
+		glVertex2f(cx - cross_size, cy + cross_size);
 		glEnd();
 	}
 }



More information about the Bf-blender-cvs mailing list