- [Graph Panel] Fix crash when grouping nodes.

This commit is contained in:
Tanasart 2023-12-26 19:28:35 +07:00
parent 599e8b1855
commit 296c7847f3
10 changed files with 22 additions and 18 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View file

@ -9,11 +9,11 @@ function groupNodes(nodeArray, _group = noone, record = true, check_connect = tr
for(var i = 0; i < array_length(nodeArray); i++) {
var node = nodeArray[i];
if(inline_context != noone) {
array_push_unique(_ctx_nodes, inline_context);
if(node.inline_context != noone) {
array_push_unique(_ctx_nodes, node.inline_context);
for( var k = 0, n = array_length(inline_context.members); k < n; k++ ) {
if(!array_exists(nodeArray, inline_context.members[k])) {
for( var k = 0, n = array_length(node.inline_context.members); k < n; k++ ) {
if(!array_exists(nodeArray, node.inline_context.members[k])) {
noti_warning("Grouping incomplete inline group is not allowed.");
return;
}

View file

@ -1257,7 +1257,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
var tx = xx + w * _s / 2;
var ty = yy + (h + 4) * _s - 2;
if(display_parameter.show_dimension) {
if(struct_get(display_parameter, "show_dimension")) {
var txt = string(getNodeDimension(_s > 0.65));
draw_text(round(tx), round(ty), txt);
ty += string_height(txt) - 2;
@ -1265,7 +1265,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
draw_set_font(f_p3);
if(display_parameter.show_compute) {
if(struct_get(display_parameter, "show_compute")) {
var rt = 0, unit = "";
if(render_time == 0) {

View file

@ -84,8 +84,7 @@ function Node_Cellular(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
case 3 : shader = sh_cell_noise_crystal; break;
}
surface_set_target(_outSurf);
shader_set(shader);
surface_set_shader(_outSurf, shader);
shader_set_f("dimension", _dim);
shader_set_f("time", _tim);
shader_set_f("position", _pos);
@ -96,9 +95,9 @@ function Node_Cellular(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
shader_set_f("radiusShatter", _sht);
shader_set_i("pattern", _pat);
shader_set_i("colored", _col);
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1]);
shader_reset();
surface_reset_target();
surface_reset_shader();
return _outSurf;
}

View file

@ -90,6 +90,11 @@ function graph_export_image(allList, nodeList, settings = {}) {
surface_set_target(cs);
DRAW_CLEAR
var _params = {
show_dimension : true,
show_compute : true,
avoid_label : true,
preview_scale : 100,
x : gr_x,
y : gr_y,
s : scale,
@ -100,7 +105,7 @@ function graph_export_image(allList, nodeList, settings = {}) {
max_layer : 1,
cur_layer : 1,
highlight : false,
log: true
log: true,
};
for(var i = 0; i < ds_list_size(nodeList); i++)
@ -122,7 +127,7 @@ function graph_export_image(allList, nodeList, settings = {}) {
for(var i = 0; i < ds_list_size(nodeList); i++) {
var _node = nodeList[| i];
if(instanceof(_node) == "Node_Frame") continue;
var val = _node.drawNode(gr_x, gr_y, mx, my, scale);
var val = _node.drawNode(gr_x, gr_y, mx, my, scale, _params);
}
#endregion