From 5c03723004d283f5b072073bc2873111ab5147df Mon Sep 17 00:00:00 2001 From: Tanasart Date: Sat, 27 Jul 2024 12:45:06 +0700 Subject: [PATCH] - [Number] Fix node size not update correctly. --- scripts/node_number/node_number.gml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/node_number/node_number.gml b/scripts/node_number/node_number.gml index 85fa4978b..692971b54 100644 --- a/scripts/node_number/node_number.gml +++ b/scripts/node_number/node_number.gml @@ -47,35 +47,41 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor static step = function() { var int = getInputData(1); var disp = getInputData(2); + var _ch = con_h; if(!show_parameter) setDimension(96, 56, false); switch(disp) { case 0 : + min_h = 0; inputs[| 3].setVisible(false); inputs[| 4].setVisible(false); inputs[| 5].setVisible(false); break; + case 1 : if(inputs[| 0].value_from == noone && !show_parameter) setDimension(160, 96, false); + min_h = con_h; inputs[| 3].setVisible(true); inputs[| 4].setVisible(true); inputs[| 5].setVisible(true); break; + case 2 : if(inputs[| 0].value_from == noone && !show_parameter) setDimension(128, 128, false); - + min_h = con_h; + inputs[| 3].setVisible(false); inputs[| 4].setVisible(false); inputs[| 5].setVisible(false); break; } - for( var i = 0; i < 1; i++ ) { - inputs[| i].setType(int? VALUE_TYPE.integer : VALUE_TYPE.float); - } + if(_ch != con_h) will_setHeight = true; + for( var i = 0; i < 1; i++ ) + inputs[| i].setType(int? VALUE_TYPE.integer : VALUE_TYPE.float); outputs[| 0].setType(int? VALUE_TYPE.integer : VALUE_TYPE.float); }