svn merge ^/trunk/blender -r48409:48411
[blender.git] / source / blender / editors / space_node / drawnode.c
index 99d3a32ece260f9b225d09d4eda788fbcfecf78c..9a3bf77843b57efab5782a7fa7ff311857bd4cc9 100644 (file)
@@ -3390,3 +3390,28 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link)
        node_draw_link_bezier(v2d, snode, link, th_col1, do_shaded, th_col2, do_triple, th_col3);
 //     node_draw_link_straight(v2d, snode, link, th_col1, do_shaded, th_col2, do_triple, th_col3);
 }
+
+void drawnodesnap(View2D *v2d, const float cent[2], float size, NodeBorder border)
+{
+       glBegin(GL_LINES);
+       
+       if (border & (NODE_LEFT | NODE_RIGHT)) {
+               glVertex2f(cent[0], v2d->cur.ymin);
+               glVertex2f(cent[0], v2d->cur.ymax);
+       }
+       else {
+               glVertex2f(cent[0], cent[1] - size);
+               glVertex2f(cent[0], cent[1] + size);
+       }
+       
+       if (border & (NODE_TOP | NODE_BOTTOM)) {
+               glVertex2f(v2d->cur.xmin, cent[1]);
+               glVertex2f(v2d->cur.xmax, cent[1]);
+       }
+       else {
+               glVertex2f(cent[0] - size, cent[1]);
+               glVertex2f(cent[0] + size, cent[1]);
+       }
+       
+       glEnd();
+}