From a30e481ffd90a0d860a32eed1ea3487963bd28be Mon Sep 17 00:00:00 2001 From: Tanasart Date: Fri, 8 Nov 2024 10:36:54 +0700 Subject: [PATCH] linn --- PixelComposer.resource_order | 1 + PixelComposer.yyp | 1 + .../draw_connect_elbow/draw_connect_elbow.gml | 38 +++++--- .../draw_connect_elbow_diag.gml | 67 ++++++++------ .../draw_connect_line/draw_connect_line.gml | 42 +++++++++ .../draw_connect_line/draw_connect_line.yy | 13 +++ scripts/draw_corner/draw_corner.gml | 6 +- scripts/node_mesh_warp/node_mesh_warp.gml | 2 +- scripts/node_value/node_value.gml | 89 ++++++++++++------- .../panel_graph_connection_settings.gml | 20 +++-- scripts/preferences/preferences.gml | 1 + 11 files changed, 198 insertions(+), 82 deletions(-) create mode 100644 scripts/draw_connect_line/draw_connect_line.gml create mode 100644 scripts/draw_connect_line/draw_connect_line.yy diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index f37e3935c..d058029ca 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -538,6 +538,7 @@ {"name":"draw_circle_functions","order":3,"path":"scripts/draw_circle_functions/draw_circle_functions.yy",}, {"name":"draw_connect_elbow_diag","order":2,"path":"scripts/draw_connect_elbow_diag/draw_connect_elbow_diag.yy",}, {"name":"draw_connect_elbow","order":1,"path":"scripts/draw_connect_elbow/draw_connect_elbow.yy",}, + {"name":"draw_connect_line","order":4,"path":"scripts/draw_connect_line/draw_connect_line.yy",}, {"name":"draw_connect_linear","order":3,"path":"scripts/draw_connect_linear/draw_connect_linear.yy",}, {"name":"draw_corner","order":13,"path":"scripts/draw_corner/draw_corner.yy",}, {"name":"draw_fit","order":11,"path":"scripts/draw_fit/draw_fit.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index ea525bbef..361c8c8e2 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -1060,6 +1060,7 @@ {"id":{"name":"draw_connect_curve","path":"scripts/draw_connect_curve/draw_connect_curve.yy",},}, {"id":{"name":"draw_connect_elbow_diag","path":"scripts/draw_connect_elbow_diag/draw_connect_elbow_diag.yy",},}, {"id":{"name":"draw_connect_elbow","path":"scripts/draw_connect_elbow/draw_connect_elbow.yy",},}, + {"id":{"name":"draw_connect_line","path":"scripts/draw_connect_line/draw_connect_line.yy",},}, {"id":{"name":"draw_connect_linear","path":"scripts/draw_connect_linear/draw_connect_linear.yy",},}, {"id":{"name":"draw_corner","path":"scripts/draw_corner/draw_corner.yy",},}, {"id":{"name":"draw_enable_alphablend","path":"scripts/draw_enable_alphablend/draw_enable_alphablend.yy",},}, diff --git a/scripts/draw_connect_elbow/draw_connect_elbow.gml b/scripts/draw_connect_elbow/draw_connect_elbow.gml index b83fe7caf..61ccc4927 100644 --- a/scripts/draw_connect_elbow/draw_connect_elbow.gml +++ b/scripts/draw_connect_elbow/draw_connect_elbow.gml @@ -1,12 +1,17 @@ -function draw_line_elbow_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = 1, thick = 1, col1 = c_white, col2 = c_white, corner = 0, indexIn = 1, indexOut = 1, type = LINE_STYLE.solid) { +function draw_line_elbow_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = 1, thick = 1, col1 = c_white, col2 = c_white, params = {}) { + var extend = params.extend; + var corner = min(extend, params.corner); + var indexIn = params.fromIndex; + var indexOut = params.toIndex; + var type = params.type; if(cx == noone) cx = (x0 + x1) / 2; if(cy == noone) cy = (y0 + y1) / 2; - var _x0 = min(x0, x1); - var _x1 = max(x0, x1); - var _y0 = min(y0, y1); - var _y1 = max(y0, y1); + var _x0 = min(x0, x1); + var _x1 = max(x0, x1); + var _y0 = min(y0, y1); + var _y1 = max(y0, y1); var th = thick / 2; var inv = x1 - 16 * indexOut * _s <= x0 + 16 * indexIn * _s; var rat = inv? (_y1 == _y0? 0.5 : (cy - _y0) / (_y1 - _y0)) : @@ -71,9 +76,14 @@ function draw_line_elbow_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = 1, t } } -function draw_line_elbow_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_white, col2 = c_white, corner = 0, indexIn = 1, indexOut = 1, type = LINE_STYLE.solid) { - var sample = corner / 4; - sample = clamp(sample, 1, 8); +function draw_line_elbow_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_white, col2 = c_white, params = {}) { + var extend = params.extend; + var corner = min(extend, params.corner); + var indexIn = params.fromIndex; + var indexOut = params.toIndex; + var type = params.type; + + var sample = clamp(corner / 4, 1, 8); var rat = abs(x0 - x1) / (abs(x0 - x1) + abs(y0 - y1)); var colc = merge_color(col1, col2, rat); @@ -87,10 +97,14 @@ function draw_line_elbow_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_whit draw_corner(x1 - corner * sx, y0, x1, y0, x1, y0 + corner * sy, thick, colc, sample); } -function distance_to_elbow(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, indexOut = 1) { - var inv = x1 - 16 * _s * indexOut <= x0 + 16 * _s * indexIn; - var xx0 = x0 + 16 * _s * indexIn; - var xx1 = x1 - 16 * _s * indexOut; +function distance_to_elbow(mx, my, x0, y0, x1, y1, cx, cy, _s, params = {}) { + var extend = params.extend; + var indexIn = params.fromIndex; + var indexOut = params.toIndex; + + var inv = x1 - extend * _s * indexOut <= x0 + extend * _s * indexIn; + var xx0 = x0 + extend * _s * indexIn; + var xx1 = x1 - extend * _s * indexOut; if(y0 != y1 && inv) { var dist = distance_to_line(mx, my, xx0, y0, xx0, cy); diff --git a/scripts/draw_connect_elbow_diag/draw_connect_elbow_diag.gml b/scripts/draw_connect_elbow_diag/draw_connect_elbow_diag.gml index 35393fa17..9ac4f0786 100644 --- a/scripts/draw_connect_elbow_diag/draw_connect_elbow_diag.gml +++ b/scripts/draw_connect_elbow_diag/draw_connect_elbow_diag.gml @@ -1,12 +1,17 @@ -function draw_line_elbow_diag_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = 1, thick = 1, c1 = c_white, c2 = c_white, corner = 0, indexIn = 1, indexOut = 1, type = LINE_STYLE.solid) { #region +function draw_line_elbow_diag_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = 1, thick = 1, c1 = c_white, c2 = c_white, params = {}) { + var extend = params.extend; + var corner = min(extend, params.corner); + var indexIn = params.fromIndex; + var indexOut = params.toIndex; + var type = params.type; + var __dash = 6 * _s; var __line = type == LINE_STYLE.solid? draw_line_width_color : draw_line_dashed_color; if(y0 == y1) { __line(x0, y0, x1, y1, thick, c1, c2, __dash); return; } - corner = min(corner, abs(y1 - y0) / 2); - var sample = floor(corner / 8); - sample = clamp(sample, 0, 8); + corner = min(corner, abs(y1 - y0) / 2); + var sample = clamp(floor(corner / 8), 0, 8); if(sample == 0) corner = 0; if(cx == noone) cx = (x0 + x1) / 2; @@ -14,13 +19,12 @@ function draw_line_elbow_diag_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = var iy = sign(y1 - y0); - var xx0 = x0 + 16 * _s * indexIn; - var xx1 = x1 - 16 * _s * indexOut; - var yy0 = y0 + 16 * _s * iy; - var yy1 = y1 - 16 * _s * iy; - - var ix = sign(xx0 - xx1); + var xx0 = x0 + extend * _s * indexIn; + var xx1 = x1 - extend * _s * indexOut; + var yy0 = y0; + var yy1 = y1; + var ix = sign(xx0 - xx1); var vert = abs(yy1 - yy0) > abs(xx1 - xx0); var inv = vert || xx1 <= xx0; var _x0 = min(x0, x1); @@ -38,17 +42,14 @@ function draw_line_elbow_diag_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = var iy1 = sign(y1 - cy); var rrx = abs(xx0 - xx1); - var cS = min(corner, 16 * _s); + var cS = min(corner, 16 * _s); if(xx1 > xx0 && !ofl) { if(abs(y1 - y0) < abs(xx1 - xx0)) cS = 0; - var cS0 = min(cS, abs(cy - y0) - rrx / 2); - cS0 = max(0, cS0); - - var cS1 = min(cS, abs(cy - y1) - rrx / 2); - cS1 = max(0, cS1); + var cS0 = clamp(cS, 0, abs(cy - y0) - rrx / 2); + var cS1 = clamp(cS, 0, abs(cy - y1) - rrx / 2); var top = abs(cy - y0) < rrx / 2; var bot = abs(y1 - cy) < rrx / 2; @@ -206,9 +207,15 @@ function draw_line_elbow_diag_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = draw_corner(_xc1 - cor2, y1 - cor2 * iy, _xc1, y1, _xc1 + corn, y1, thick, cm, sample); } } -} #endregion +} -function draw_line_elbow_diag_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_white, col2 = c_white, corner = 0, indexIn = 1, indexOut = 1, type = LINE_STYLE.solid) { #region +function draw_line_elbow_diag_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_white, col2 = c_white, params = {}) { + var extend = params.extend; + var corner = min(extend, params.corner); + var indexIn = params.fromIndex; + var indexOut = params.toIndex; + var type = params.type; + var sample = floor(corner / 8); sample = clamp(sample, 0, 8); if(sample == 0) corner = 0; @@ -229,16 +236,18 @@ function draw_line_elbow_diag_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c draw_corner(x1 - (diag + corner) * sx, y0, x1 - diag * sx, y0, x1 - (diag - cor2) * sx, y0 + cor2 * sy, thick, colc, sample); draw_corner(x1 - cor2 * sx, y0 + (diag - cor2) * sy, x1, y0 + diag * sy, x1, y0 + (diag + corner) * sy, thick, colc, sample); - //draw_circle(x1 - diag * sx, y0, 4, false); - //draw_circle(x1, y0 + diag * sy, 4, false); -} #endregion +} -function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, indexOut = 1) { #region +function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, params = {}) { + var extend = params.extend; + var indexIn = params.fromIndex; + var indexOut = params.toIndex; + var iy = sign(y1 - y0); - var xx0 = x0 + 16 * _s * indexIn; - var xx1 = x1 - 16 * _s * indexOut; - var yy0 = y0 + 16 * _s * iy; - var yy1 = y1 - 16 * _s * iy; + var xx0 = x0 + extend * _s * indexIn; + var xx1 = x1 - extend * _s * indexOut; + var yy0 = y0; + var yy1 = y1; var vert = abs(yy1 - yy0) > abs(xx1 - xx0); var inv = vert || xx1 <= xx0; @@ -330,9 +339,9 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, return dist; } -} #endregion +} -function distance_to_elbow_diag_corner(mx, my, x0, y0, x1, y1) { #region +function distance_to_elbow_diag_corner(mx, my, x0, y0, x1, y1) { var sx = sign(x1 - x0); var sy = sign(y1 - y0); var diag = min(abs(x0 - x1) / 2, abs(y0 - y1) / 2); @@ -343,4 +352,4 @@ function distance_to_elbow_diag_corner(mx, my, x0, y0, x1, y1) { #region dist = min(dist, distance_to_line(mx, my, x1, y0 + diag * sy, x1, y1)); return dist; -} #endregion \ No newline at end of file +} \ No newline at end of file diff --git a/scripts/draw_connect_line/draw_connect_line.gml b/scripts/draw_connect_line/draw_connect_line.gml new file mode 100644 index 000000000..20591e532 --- /dev/null +++ b/scripts/draw_connect_line/draw_connect_line.gml @@ -0,0 +1,42 @@ +function draw_line_connect(x0, y0, x1, y1, _s = 1, thick = 1, c1 = c_white, c2 = c_white, params = {}) { + var extend = params.extend; + var corner = min(extend, params.corner); + var type = params.type; + + var sample = clamp(corner / 4, 1, 8); + + var xx0 = x0 + extend * _s; + var xx1 = x1 - extend * _s; + var dir = point_direction(xx0, y0, xx1, y1); + + var cx0 = xx0 + lengthdir_x(corner, dir); + var cy0 = y0 + lengthdir_y(corner, dir); + var cx1 = xx1 - lengthdir_x(corner, dir); + var cy1 = y1 - lengthdir_y(corner, dir); + + draw_line_width_color( x0, y0, xx0 - corner, y0, thick, c1, c1); + draw_line_width_color(xx1 + corner, y1, x1, y1, thick, c2, c2); + draw_line_width_color(cx0, cy0, cx1, cy1, thick, c1, c2); + + draw_corner(xx0 - corner, y0, + xx0, y0, + cx0, cy0, + thick, c1, sample); + + draw_corner(cx1, cy1, + xx1, y1, + xx1 + corner, y1, + thick, c2, sample); + +} + +function distance_to_linear_connection(mx, my, x0, y0, x1, y1, _s, params = {}) { + var extend = params.extend; + var indexIn = params.fromIndex; + var indexOut = params.toIndex; + + var xx0 = x0 + extend * _s; + var xx1 = x1 - extend * _s; + + return distance_to_line(mx, my, xx0, y0, xx1, y1); +} \ No newline at end of file diff --git a/scripts/draw_connect_line/draw_connect_line.yy b/scripts/draw_connect_line/draw_connect_line.yy new file mode 100644 index 000000000..bf511fa56 --- /dev/null +++ b/scripts/draw_connect_line/draw_connect_line.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"draw_connect_line", + "isCompatibility":false, + "isDnD":false, + "name":"draw_connect_line", + "parent":{ + "name":"connection", + "path":"folders/functions/connection.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/draw_corner/draw_corner.gml b/scripts/draw_corner/draw_corner.gml index b60f39c56..8e3d389fa 100644 --- a/scripts/draw_corner/draw_corner.gml +++ b/scripts/draw_corner/draw_corner.gml @@ -18,7 +18,11 @@ function draw_corner(x1, y1, xc, yc, x3, y3, thick = 1, col = c_white, sample = var y4 = p4[1]; var ra = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4); - if(ra == 0) return; + if(ra == 0) { + __draw_set_color(col); + draw_line_width(x1, y1, x3, y3, thick); + return; + } var px = ((x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4)) / ra; var py = ((x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4)) / ra; diff --git a/scripts/node_mesh_warp/node_mesh_warp.gml b/scripts/node_mesh_warp/node_mesh_warp.gml index 8b2177027..ed288eca0 100644 --- a/scripts/node_mesh_warp/node_mesh_warp.gml +++ b/scripts/node_mesh_warp/node_mesh_warp.gml @@ -723,7 +723,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) for(var i = control_index; i < array_length(inputs); i++) { var c = getInputData(i); - if(c[0] == PUPPET_FORCE_MODE.puppet) + if(c[0] == PUPPET_FORCE_MODE.puppet) array_push(mesh_data.controls, c); } diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 00e9e8f6b..cf2f5693b 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -2049,9 +2049,22 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var _action = type == VALUE_TYPE.action; var _output = connect_type == CONNECT_TYPE.output; + var _drawParam = { + corner : corner, + extend : PREFERENCES.connection_line_extend, + fromIndex : 1, + toIndex : 1, + type : LINE_STYLE.solid, + } switch(PREFERENCES.curve_connection_line) { - case 0 : draw_line_width(sx, sy, _mx, _my, th); break; + case 0 : + if(drawCorner) draw_line_width(sx, sy, _mx, _my, th); + else { + if(_output) draw_line_connect(sx, sy, _mx, _my, ss, th, col, col, _drawParam); + else draw_line_connect(_mx, _my, sx, sy, ss, th, col, col, _drawParam); + } + break; case 1 : if(drawCorner) { @@ -2065,21 +2078,21 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru case 2 : if(drawCorner) { - if(_action) draw_line_elbow_corner(_mx, _my, sx, sy, ss, th, col, col, corner); - else draw_line_elbow_corner(sx, sy, _mx, _my, ss, th, col, col, corner); + if(_action) draw_line_elbow_corner(_mx, _my, sx, sy, ss, th, col, col, _drawParam); + else draw_line_elbow_corner(sx, sy, _mx, _my, ss, th, col, col, _drawParam); } else { - if(_output) draw_line_elbow_color(sx, sy, _mx, _my,,, ss, th, col, col, corner); - else draw_line_elbow_color(_mx, _my, sx, sy,,, ss, th, col, col, corner); + if(_output) draw_line_elbow_color(sx, sy, _mx, _my,,, ss, th, col, col, _drawParam); + else draw_line_elbow_color(_mx, _my, sx, sy,,, ss, th, col, col, _drawParam); } break; case 3 : if(drawCorner) { - if(_action) draw_line_elbow_diag_corner(_mx, _my, sx, sy, ss, th, col, col, corner); - else draw_line_elbow_diag_corner(sx, sy, _mx, _my, ss, th, col, col, corner); + if(_action) draw_line_elbow_diag_corner(_mx, _my, sx, sy, ss, th, col, col, _drawParam); + else draw_line_elbow_diag_corner(sx, sy, _mx, _my, ss, th, col, col, _drawParam); } else { - if(_output) draw_line_elbow_diag_color(sx, sy, _mx, _my,,, ss, th, col, col, corner); - else draw_line_elbow_diag_color(_mx, _my, sx, sy,,, ss, th, col, col, corner); + if(_output) draw_line_elbow_diag_color(sx, sy, _mx, _my,,, ss, th, col, col, _drawParam); + else draw_line_elbow_diag_color(_mx, _my, sx, sy,,, ss, th, col, col, _drawParam); } break; } @@ -2434,38 +2447,45 @@ function drawJuncConnection(from, to, params) { #endregion #region +++++ CHECK HOVER +++++ + var _drawParam = { + extend : PREFERENCES.connection_line_extend, + fromIndex : fromIndex, + toIndex : toIndex, + } var hovDist = max(th * 2, 6); if(PANEL_GRAPH.pHOVER) { if(_loop || from.node == to.node) { hover = distance_line_feedback(mx, my, jx, jy, frx, fry, _s) < hovDist; + } else { + var _hdist = 999999; + switch(PREFERENCES.curve_connection_line) { case 0 : - hover = distance_to_line(mx, my, jx, jy, frx, fry) < hovDist; + if(downDirection) _hdist = distance_to_line(mx, my, jx, jy, frx, fry); + else _hdist = distance_to_linear_connection(mx, my, jx, jy, frx, fry, _s, _drawParam); break; - case 1 : - if(downDirection) hover = distance_to_curve_corner(mx, my, jx, jy, frx, fry, _s) < hovDist; - else hover = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s) < hovDist; - if(PANEL_GRAPH.value_focus == noone) - to.draw_line_shift_hover = hover; + case 1 : + if(downDirection) _hdist = distance_to_curve_corner(mx, my, jx, jy, frx, fry, _s); + else _hdist = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s); break; + case 2 : - if(downDirection) hover = distance_to_elbow_corner(mx, my, frx, fry, jx, jy) < hovDist; - else hover = distance_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s, fromIndex, toIndex) < hovDist; - - if(PANEL_GRAPH.value_focus == noone) - to.draw_line_shift_hover = hover; + if(downDirection) _hdist = distance_to_elbow_corner(mx, my, frx, fry, jx, jy); + else _hdist = distance_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s, _drawParam); break; + case 3 : - if(downDirection) hover = distance_to_elbow_diag_corner(mx, my, frx, fry, jx, jy) < hovDist; - else hover = distance_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, fromIndex, toIndex) < hovDist; - - if(PANEL_GRAPH.value_focus == noone) - to.draw_line_shift_hover = hover; + if(downDirection) _hdist = distance_to_elbow_diag_corner(mx, my, frx, fry, jx, jy); + else _hdist = distance_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, _drawParam); break; + } + + hover = _hdist < hovDist; + if(PANEL_GRAPH.value_focus == noone) to.draw_line_shift_hover = hover; } } @@ -2526,23 +2546,30 @@ function drawJuncConnection(from, to, params) { if(_loop || from.node == to.node) { draw_line_feedback(jx, jy, frx, fry, th, c1, c0, ss); } else { + _drawParam.corner = corner; + _drawParam.type = ty; + switch(PREFERENCES.curve_connection_line) { case 0 : - if(ty == LINE_STYLE.solid) draw_line_width_color(jx, jy, frx, fry, th, c1, c0); - else draw_line_dashed_color(jx, jy, frx, fry, th, c1, c0, 6 * ss); + if(downDirection) draw_line_width_color(jx, jy, frx, fry, th, c1, c0); + else draw_line_connect(frx, fry, jx, jy, ss, th, c1, c0, _drawParam); break; + case 1 : if(downDirection) draw_line_curve_corner(jx, jy, frx, fry, ss, th, c0, c1); else draw_line_curve_color(jx, jy, frx, fry, cx, cy, ss, th, c0, c1, ty); break; + case 2 : - if(downDirection) draw_line_elbow_corner(frx, fry, jx, jy, ss, th, c0, c1, corner, fromIndex, toIndex, ty); - else draw_line_elbow_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, fromIndex, toIndex, ty); + if(downDirection) draw_line_elbow_corner(frx, fry, jx, jy, ss, th, c0, c1, _drawParam); + else draw_line_elbow_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, _drawParam); break; + case 3 : - if(downDirection) draw_line_elbow_diag_corner(frx, fry, jx, jy, ss, th, c0, c1, corner, fromIndex, toIndex, ty); - else draw_line_elbow_diag_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, fromIndex, toIndex, ty); + if(downDirection) draw_line_elbow_diag_corner(frx, fry, jx, jy, ss, th, c0, c1, _drawParam); + else draw_line_elbow_diag_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, _drawParam); break; + } } diff --git a/scripts/panel_graph_connection_settings/panel_graph_connection_settings.gml b/scripts/panel_graph_connection_settings/panel_graph_connection_settings.gml index cb6030e4c..2c74cfdd0 100644 --- a/scripts/panel_graph_connection_settings/panel_graph_connection_settings.gml +++ b/scripts/panel_graph_connection_settings/panel_graph_connection_settings.gml @@ -5,38 +5,42 @@ function Panel_Graph_Connection_Setting() : Panel_Linear_Setting() constructor { new __Panel_Linear_Setting_Item_Preference( __txt("Type"), "curve_connection_line", - new buttonGroup([ THEME.icon_curve_connection, THEME.icon_curve_connection, THEME.icon_curve_connection, THEME.icon_curve_connection ], - function(val) { PREFERENCES.curve_connection_line = val; }), + new buttonGroup(array_create(4, THEME.icon_curve_connection), function(val) /*=>*/ { PREFERENCES.curve_connection_line = val; }), ), new __Panel_Linear_Setting_Item_Preference( __txtx("dialog_connection_thickness", "Line thickness"), "connection_line_width", - new textBox(TEXTBOX_INPUT.number, function(str) { PREFERENCES.connection_line_width = max(0.5, real(str)); }), + new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.connection_line_width = max(0.5, real(str)); }), ), new __Panel_Linear_Setting_Item_Preference( __txtx("dialog_connection_radius", "Corner radius"), "connection_line_corner", - new textBox(TEXTBOX_INPUT.number, function(str) { PREFERENCES.connection_line_corner = max(0, real(str)); }), + new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.connection_line_corner = max(0, real(str)); }), + ), + new __Panel_Linear_Setting_Item_Preference( + __txtx("dialog_connection_extends", "Extends"), + "connection_line_extend", + new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.connection_line_extend = max(0, real(str)); }), ), new __Panel_Linear_Setting_Item_Preference( __txtx("pref_connection_quality", "Render quality"), "connection_line_aa", - new textBox(TEXTBOX_INPUT.number, function(str) { PREFERENCES.connection_line_aa = clamp(real(str), 1, 4); }), + new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.connection_line_aa = clamp(real(str), 1, 4); }), ), new __Panel_Linear_Setting_Item_Preference( __txtx("pref_connection_highlight", "Highlight connection"), "connection_line_highlight", - new buttonGroup([ "None", "ALT", "Always" ], function(val) { PREFERENCES.connection_line_highlight = val; }), + new buttonGroup([ "None", "ALT", "Always" ], function(val) /*=>*/ { PREFERENCES.connection_line_highlight = val; }), ), new __Panel_Linear_Setting_Item_Preference( __txtx("pref_connection_highlight_fade", "Fade connection"), "connection_line_highlight_fade", - slider(0, 1, 0.05, function(val) { PREFERENCES.connection_line_highlight_fade = val; }), + slider(0, 1, 0.05, function(val) /*=>*/ { PREFERENCES.connection_line_highlight_fade = val; }), ), new __Panel_Linear_Setting_Item_Preference( __txtx("pref_connection_highlight_all", "Highlight all"), "connection_line_highlight_all", - new checkBox(function() { PREFERENCES.connection_line_highlight_all = !PREFERENCES.connection_line_highlight_all; }), + new checkBox(function() /*=>*/ { PREFERENCES.connection_line_highlight_all = !PREFERENCES.connection_line_highlight_all; }), ), ]; diff --git a/scripts/preferences/preferences.gml b/scripts/preferences/preferences.gml index 5fc69a42e..5dfd353b3 100644 --- a/scripts/preferences/preferences.gml +++ b/scripts/preferences/preferences.gml @@ -108,6 +108,7 @@ PREFERENCES.connection_line_highlight = 0; PREFERENCES.connection_line_highlight_fade = 0.75; PREFERENCES.connection_line_highlight_all = false; + PREFERENCES.connection_line_extend = 16; PREFERENCES.curve_connection_line = 1; PREFERENCES.collection_animated = true;