From 766f6bd39dde6d220f5d3732d733f3fd55a56d57 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Sat, 24 Aug 2024 08:25:27 +0700 Subject: [PATCH] - [Transform] Fix error when animating position. --- scripts/globals/globals.gml | 4 +- scripts/node_registry/node_registry.gml | 2 +- scripts/node_transform/node_transform.gml | 57 ++++++++++++----------- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 301e1135e..2c2785ea9 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -36,10 +36,10 @@ globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION; globalvar HOTKEYS, HOTKEY_CONTEXT; - LATEST_VERSION = 1_16_00_0; + LATEST_VERSION = 1_16_00; VERSION = 1_17_11_0; SAVE_VERSION = 1_17_10_0; - VERSION_STRING = "1.17.11.002"; + VERSION_STRING = "1.17.11.003"; BUILD_NUMBER = 1_17_11_0; HOTKEYS = ds_map_create(); diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index fac912bcd..9c92c164b 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -1034,7 +1034,7 @@ function __initNodes() { ds_list_add(node, "Groups"); addNodeObject(node, "Group", s_node_group, "Node_Group", [1, Node_Group]); - addNodeObject(node, "Feedback", s_node_feedback, "Node_Feedback", [1, Node_Feedback],, "Create a group that reuse output from last frame to the current one."); + addNodeObject(node, "Feedback", s_node_feedback, "Node_Feedback", [1, Node_Feedback],, "Create a group that reuse output from last frame to the current one.").isDeprecated(); addNodeObject(node, "Loop", s_node_loop, "Node_Iterate", [1, Node_Iterate], ["iterate", "for"], "Create group that reuse output as input repeatedly in one frame.").isDeprecated(); addNodeObject(node, "Loop Array", s_node_loop_array, "Node_Iterate_Each_Inline", [1, Node_Iterate_Each_Inline], ["iterate each", "for each", "array loop"], "Create group that iterate to each member in an array."); addNodeObject(node, "Filter Array", s_node_filter_array, "Node_Iterate_Filter_Inline", [1, Node_Iterate_Filter_Inline],, "Filter array using condition.").setVersion(1140); diff --git a/scripts/node_transform/node_transform.gml b/scripts/node_transform/node_transform.gml index afc253a6f..d86db844d 100644 --- a/scripts/node_transform/node_transform.gml +++ b/scripts/node_transform/node_transform.gml @@ -587,40 +587,41 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) overlay_drag_sy = _pos[1]; } } - - #region path - if(inputs[2].is_anim && inputs[2].value_from == noone && !inputs[2].sep_axis) { - var posInp = inputs[2]; - var allPos = posInp.animator.values; - var ox, oy, nx, ny; + + if(inputs[2].is_anim && inputs[2].value_from == noone && !inputs[2].sep_axis) { // draw path + var posInp = inputs[2]; + var allPos = posInp.animator.values; + var ox, oy, nx, ny; + var _val, _px, _py; - draw_set_color(COLORS._main_accent); + draw_set_color(COLORS._main_accent); - for( var i = 0; i < ds_list_size(allPos); i++ ) { - var pos = allPos[| i].value; - var _pos = [ pos[0], pos[1] ]; - - if(posInp.unit.mode == VALUE_UNIT.reference) { - _pos[0] *= ow; - _pos[1] *= oh; - } + for( var i = 0, n = array_length(allPos); i < n; i++ ) { + _val = allPos[i].value; + _px = _val[0]; + _py = _val[1]; - nx = _x + _pos[0] * _s; - ny = _y + _pos[1] * _s; - - draw_set_alpha(1); - draw_circle_prec(nx, ny, 4, false); - if(i) { - draw_set_alpha(0.5); - draw_line_dashed(ox, oy, nx, ny); - } - - ox = nx; - oy = ny; + if(posInp.unit.mode == VALUE_UNIT.reference) { + _px *= ow; + _py *= oh; } + nx = _x + _px * _s; + ny = _y + _py * _s; + draw_set_alpha(1); + draw_circle_prec(nx, ny, 4, false); + + if(i) { + draw_set_alpha(0.5); + draw_line_dashed(ox, oy, nx, ny); + } + + ox = nx; + oy = ny; } - #endregion + + draw_set_alpha(1); + } } } \ No newline at end of file