Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r--source/blender/editors/space_node/drawnode.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index cc58c4174b3..d644747413b 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3351,3 +3351,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();
+}