diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-04-05 17:07:28 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-04-05 17:08:46 +0300 |
commit | 1c1dc394662965356eee2347d824026cd9d18756 (patch) | |
tree | 7128f3c8693a64d76f0f52ac78075a775d374669 /source/blender/editors/space_node/drawnode.c | |
parent | fb8a1a58d9a6ce68937111f1d9763ec6c09e0235 (diff) |
UI: Node Editor: Make nodelink arrow size and link width dpi dependant.
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 8865e7b40f9..1cb9c57404a 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3394,11 +3394,10 @@ bool node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, flo #define NODELINK_GROUP_SIZE 256 #define LINK_RESOL 24 -#define LINK_WIDTH 2.5f -// #define ARROW_SIZE (7 * UI_DPI_FAC) -#define ARROW_SIZE 7 +#define LINK_WIDTH (2.5f * UI_DPI_FAC) +#define ARROW_SIZE (7 * UI_DPI_FAC) -static float arrow_verts[3][2] = {{-ARROW_SIZE, ARROW_SIZE}, {0.0f, 0.0f}, {-ARROW_SIZE, -ARROW_SIZE}}; +static float arrow_verts[3][2] = {{-1.0f, 1.0f}, {0.0f, 0.0f}, {-1.0f, -1.0f}}; static float arrow_expand_axis[3][2] = {{0.7071f, 0.7071f}, {M_SQRT2, 0.0f}, {0.7071f, -0.7071f}}; struct { @@ -3542,6 +3541,7 @@ static void nodelink_batch_draw(SpaceNode *snode) GWN_batch_program_set_builtin(g_batch_link.batch, GPU_SHADER_2D_NODELINK_INST); GWN_batch_uniform_4fv_array(g_batch_link.batch, "colors", 6, (float *)colors); GWN_batch_uniform_1f(g_batch_link.batch, "expandSize", snode->aspect * LINK_WIDTH); + GWN_batch_uniform_1f(g_batch_link.batch, "arrowSize", ARROW_SIZE); GWN_batch_draw(g_batch_link.batch); nodelink_batch_reset(); @@ -3618,6 +3618,7 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, GWN_batch_uniform_2fv_array(batch, "bezierPts", 4, (float *)vec); GWN_batch_uniform_4fv_array(batch, "colors", 3, (float *)colors); GWN_batch_uniform_1f(batch, "expandSize", snode->aspect * LINK_WIDTH); + GWN_batch_uniform_1f(batch, "arrowSize", ARROW_SIZE); GWN_batch_uniform_1i(batch, "doArrow", drawarrow); GWN_batch_draw(batch); } |