diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-09 23:50:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-09 23:50:43 +0400 |
commit | e66a02e7e21adf6932403890166e7e2c8e266649 (patch) | |
tree | c86bfaca9e945e3fa695105b9c4560ca56d61f4e /source/blender/editors/space_node/node_draw.c | |
parent | 18f28e5408940748b3966b8100cde73141857517 (diff) |
improve node text alignment with different zoom levels
Diffstat (limited to 'source/blender/editors/space_node/node_draw.c')
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index fdd3f6330ab..7f3b7cd2dab 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -798,7 +798,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - don't print into self! uiDefBut(node->block, LABEL, 0, showname, - (int)(rct->xmin + 15), (int)(rct->ymax - NODE_DY), + (int)(rct->xmin + (NODE_MARGIN_X / snode->aspect_sqrt)), (int)(rct->ymax - NODE_DY), (short)(iconofs - rct->xmin - 18.0f), (short)NODE_DY, NULL, 0, 0, 0, 0, ""); @@ -841,7 +841,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN node_socket_circle_draw(ntree, sock, NODE_SOCKSIZE, sock->flag & SELECT); node->typeinfo->drawinputfunc(C, node->block, ntree, node, sock, IFACE_(sock->name), - sock->locx+NODE_DYS, sock->locy-NODE_DYS, node->width-NODE_DY); + sock->locx + (NODE_DYS / snode->aspect_sqrt), sock->locy-NODE_DYS, node->width-NODE_DY); } /* socket outputs */ @@ -852,7 +852,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN node_socket_circle_draw(ntree, sock, NODE_SOCKSIZE, sock->flag & SELECT); node->typeinfo->drawoutputfunc(C, node->block, ntree, node, sock, IFACE_(sock->name), - sock->locx-node->width+NODE_DYS, sock->locy-NODE_DYS, node->width-NODE_DY); + sock->locx - node->width + (NODE_DYS / snode->aspect_sqrt), sock->locy-NODE_DYS, node->width-NODE_DY); } /* preview */ @@ -949,7 +949,7 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - don't print into self! uiDefBut(node->block, LABEL, 0, showname, - (int)(rct->xmin + 15), (int)(centy - 10), + (int)(rct->xmin + (NODE_MARGIN_X / snode->aspect_sqrt)), (int)(centy - 10), (short)(rct->xmax - rct->xmin-18.0f -12.0f), (short)NODE_DY, NULL, 0, 0, 0, 0, ""); } |