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:
authorJulian Eisel <eiseljulian@gmail.com>2015-08-01 17:16:16 +0300
committerJulian Eisel <eiseljulian@gmail.com>2015-08-01 18:23:32 +0300
commit31bf82c17d780660160ebf4e1a4be004b8933b9d (patch)
tree9e886260807491d68fb3ece56ee27b491525936b /source/blender/editors/space_node/node_draw.c
parentfa1945c9e52e7afea9db20447335b9b4e108de2f (diff)
Node Editor: A bunch of new utility functions
Needed for node insert offset (Auto-offset in UI), but kept separate so people notice it without having to check insert offset commit (not for commit ratio of course ;) )
Diffstat (limited to 'source/blender/editors/space_node/node_draw.c')
-rw-r--r--source/blender/editors/space_node/node_draw.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 34efba00b86..28afeefae0b 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -308,6 +308,12 @@ void node_to_view(struct bNode *node, float x, float y, float *rx, float *ry)
*ry *= UI_DPI_FAC;
}
+void node_to_updated_rect(struct bNode *node, rctf *r_rect)
+{
+ node_to_view(node, node->offsetx, node->offsety, &r_rect->xmin, &r_rect->ymax);
+ node_to_view(node, node->offsetx + node->width, node->offsety - node->height, &r_rect->xmax, &r_rect->ymin);
+}
+
void node_from_view(struct bNode *node, float x, float y, float *rx, float *ry)
{
x /= UI_DPI_FAC;