diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-20 19:29:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-20 19:29:02 +0400 |
commit | 26f073b327ac31d683e1719ce8371b6e28bf01d6 (patch) | |
tree | fecb4fdc3f279436ab3814e60266633ba02de50a /source/blender/editors/space_node/drawnode.c | |
parent | 831eaf2d7feb63ee6df55a2b00e1d76f793c0a5c (diff) |
macros for rectangle center and size
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 615c4fb4b46..68286554093 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -522,7 +522,7 @@ static void node_update_group(const bContext *C, bNodeTree *ntree, bNode *gnode) rect->ymax += NODE_DY; /* input sockets */ - dy = 0.5f * (rect->ymin + rect->ymax) + NODE_DY * (BLI_countlist(&gnode->inputs) - 1); + dy = BLI_RCT_CENTER_Y(rect) + (NODE_DY * (BLI_countlist(&gnode->inputs) - 1)); gsock = ngroup->inputs.first; sock = gnode->inputs.first; while (gsock || sock) { @@ -570,7 +570,7 @@ static void node_update_group(const bContext *C, bNodeTree *ntree, bNode *gnode) } /* output sockets */ - dy = 0.5f * (rect->ymin + rect->ymax) + NODE_DY * (BLI_countlist(&gnode->outputs) - 1); + dy = BLI_RCT_CENTER_Y(rect) + (NODE_DY * (BLI_countlist(&gnode->outputs) - 1)); gsock = ngroup->outputs.first; sock = gnode->outputs.first; while (gsock || sock) { @@ -979,7 +979,7 @@ static void node_draw_frame_label(bNode *node, const float aspect) ascender = BLF_ascender(fontid); /* 'x' doesn't need aspect correction */ - x = 0.5f * (rct->xmin + rct->xmax) - 0.5f * width; + x = BLI_RCT_CENTER_X(rct) - (0.5f * width); y = rct->ymax - (((NODE_DY / 4) / aspect) + (ascender * aspect)); BLF_position(fontid, x, y, 0); |