mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 06:26:42 +01:00
[Array Range] Step sign now defines by start - end values. (You can now use positive step value when end is less than start.)
This commit is contained in:
parent
2714540e4a
commit
7e8c6758e9
1 changed files with 10 additions and 9 deletions
|
@ -17,16 +17,17 @@ function Node_Array_Range(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
var st = _data[0];
|
var st = _data[0];
|
||||||
var ed = _data[1];
|
var ed = _data[1];
|
||||||
var stp = _data[2];
|
var stp = _data[2];
|
||||||
var arr = [];
|
|
||||||
|
|
||||||
if(st == ed) {
|
if(st == ed)
|
||||||
arr = array_create(stp, st);
|
return array_create(abs(stp), st);
|
||||||
} else if(sign(stp) == sign(ed - st)) {
|
|
||||||
var _amo = floor(abs((ed - st) / stp));
|
stp = abs(stp) * sign(ed - st);
|
||||||
|
|
||||||
for( var i = 0; i < _amo; i++ )
|
var _amo = floor(abs((ed - st) / stp));
|
||||||
array_push(arr, st + i * stp);
|
var arr = array_create(_amo);
|
||||||
}
|
|
||||||
|
for( var i = 0; i < _amo; i++ )
|
||||||
|
arr[i] = st + i * stp;
|
||||||
|
|
||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue