[Feedback] Fix connection line still being drawn after deleting the node.

This commit is contained in:
Tanasart 2025-01-06 11:10:01 +07:00
parent c6cf05c2f8
commit 4fcbe11f4d
10 changed files with 37 additions and 32 deletions

Binary file not shown.

View file

@ -139,13 +139,13 @@ if(DIALOG_SHOW_FOCUS) DIALOG_DRAW_FOCUS
var _sx = node_icon_x - ui(16);
var _sy = node_icon_y;
var _sw = sprite_get_width(node_icon) + ui(48);
var _sh = sprite_get_height(node_icon) + ui(48);
var _sw = sprite_get_width(node_icon) + ui(16);
var _sh = sprite_get_height(node_icon) + ui(16);
var _bgx = _sx - _sw / 2;
var _bgy = _sy - _sh / 2;
draw_sprite_stretched(s_node_junction_name_bg, 0, _bgx, _bgy, _sw, _sh);
draw_sprite_stretched(THEME.node_junction_name_bg, 0, _bgx, _bgy, _sw, _sh);
draw_sprite_ext(node_icon, 0, _sx, _sy, 1, 1);
node_icon = noone;
}

View file

@ -30,7 +30,7 @@ function armatureBox(_junction) : widget() constructor {
b_newTileset.drawParam(param);
} else {
var ic = s_bone;
var ic = THEME.bone;
var iw = ui(24);
var _s = (iw - ui(8)) / max(sprite_get_width(ic), sprite_get_height(ic));
var bi = 0;

View file

@ -297,7 +297,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
var _rx = _x + _s * builder_sx;
var _ry = _y + _s * builder_sy;
draw_sprite_ext(s_bone_rotate, 0, _rx, _ry, 1, 1, builder_bone.angle, COLORS._main_value_positive, 1);
draw_sprite_ext(THEME.bone_rotate, 0, _rx, _ry, 1, 1, builder_bone.angle, COLORS._main_value_positive, 1);
} else if(builder_type == 3) {
@ -306,7 +306,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
orig = builder_bone.getPoint(0.8);
var _rx = _x + _s * orig.x;
var _ry = _y + _s * orig.y;
draw_sprite_ext(s_bone_scale, 0, _rx, _ry, 1, 1, builder_bone.angle, COLORS._main_value_positive, 1);
draw_sprite_ext(THEME.bone_scale, 0, _rx, _ry, 1, 1, builder_bone.angle, COLORS._main_value_positive, 1);
} else if(key_mod_press(ALT)) {
if(builder_type == 0) {
@ -360,7 +360,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
}
}
draw_sprite_ext(s_bone_move, 0, _rx, _ry, 1, 1, 0, cc, 1);
draw_sprite_ext(THEME.bone_move, 0, _rx, _ry, 1, 1, 0, cc, 1);
} else if(builder_type == 1) {
builder_bone.angle = dir;
@ -369,7 +369,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
orig = builder_bone.getTail();
var _rx = _x + _s * orig.x;
var _ry = _y + _s * orig.y;
draw_sprite_ext(s_bone_move, 0, _rx, _ry, 1, 1, 0, COLORS._main_value_positive, 1);
draw_sprite_ext(THEME.bone_move, 0, _rx, _ry, 1, 1, 0, COLORS._main_value_positive, 1);
}
}
@ -768,11 +768,11 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
if(_typ == 0) { // free move
var orig = _bne.getHead();
draw_sprite_ext(s_bone_move, 0, _x + _s * orig.x, _y + _s * orig.y, 1, 1, 0, COLORS._main_accent, 1);
draw_sprite_ext(THEME.bone_move, 0, _x + _s * orig.x, _y + _s * orig.y, 1, 1, 0, COLORS._main_accent, 1);
} else if(_typ == 1) { // bone move
var orig = _bne.getTail();
draw_sprite_ext(s_bone_move, 0, _x + _s * orig.x, _y + _s * orig.y, 1, 1, 0, COLORS._main_accent, 1);
draw_sprite_ext(THEME.bone_move, 0, _x + _s * orig.x, _y + _s * orig.y, 1, 1, 0, COLORS._main_accent, 1);
} else if(_typ == 2) { // bone rotate
var orig = _bne.getHead();
@ -784,13 +784,13 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
var _sy = _y + _s * orig.y;
if(point_in_circle(_mx, _my, _sx, _sy, 12)) {
draw_sprite_ext(s_bone_scale, 0, _sx, _sy, 1, 1, _bne.angle, COLORS._main_accent, 1);
draw_sprite_ext(s_bone_rotate, 0, _rx, _ry, 1, 1, _bne.angle, c_white, 1);
draw_sprite_ext(THEME.bone_scale, 0, _sx, _sy, 1, 1, _bne.angle, COLORS._main_accent, 1);
draw_sprite_ext(THEME.bone_rotate, 0, _rx, _ry, 1, 1, _bne.angle, c_white, 1);
_typ = 3;
} else {
draw_sprite_ext(s_bone_scale, 0, _sx, _sy, 1, 1, _bne.angle, c_white, 1);
draw_sprite_ext(s_bone_rotate, 0, _rx, _ry, 1, 1, _bne.angle, COLORS._main_accent, 1);
draw_sprite_ext(THEME.bone_scale, 0, _sx, _sy, 1, 1, _bne.angle, c_white, 1);
draw_sprite_ext(THEME.bone_rotate, 0, _rx, _ry, 1, 1, _bne.angle, COLORS._main_accent, 1);
_typ = 2;
}
}

View file

@ -144,7 +144,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
orig = posing_bone.getHead();
var _rx = _x + _s * orig.x;
var _ry = _y + _s * orig.y;
draw_sprite_ext(s_bone_move, 0, _rx, _ry, 1, 1, 0, COLORS._main_value_positive, 1);
draw_sprite_ext(THEME.bone_move, 0, _rx, _ry, 1, 1, 0, COLORS._main_value_positive, 1);
} else if(posing_type == 1) { //free move
var _direction = point_direction(posing_sx, posing_sy, smx, smy);
@ -176,7 +176,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
orig = posing_bone.getTail();
var _rx = _x + _s * orig.x;
var _ry = _y + _s * orig.y;
draw_sprite_ext(s_bone_move, 0, _rx, _ry, 1, 1, 0, COLORS._main_value_positive, 1);
draw_sprite_ext(THEME.bone_move, 0, _rx, _ry, 1, 1, 0, COLORS._main_value_positive, 1);
} else if(posing_type == 2) { //rotate
var ori = posing_bone.getHead();
@ -201,7 +201,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
orig = posing_bone.getHead();
var _rx = _x + _s * orig.x;
var _ry = _y + _s * orig.y;
draw_sprite_ext(s_bone_rotate, 0, _rx, _ry, 1, 1, posing_bone.pose_angle, COLORS._main_value_positive, 1);
draw_sprite_ext(THEME.bone_rotate, 0, _rx, _ry, 1, 1, posing_bone.pose_angle, COLORS._main_value_positive, 1);
} else if(posing_type == 3) { //scale
var ps = val[TRANSFORM.sca_x];
@ -223,7 +223,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
orig = posing_bone.getPoint(0.8);
var _rx = _x + _s * orig.x;
var _ry = _y + _s * orig.y;
draw_sprite_ext(s_bone_scale, 0, _rx, _ry, 1, 1, posing_bone.pose_angle, COLORS._main_value_positive, 1);
draw_sprite_ext(THEME.bone_scale, 0, _rx, _ry, 1, 1, posing_bone.pose_angle, COLORS._main_value_positive, 1);
}
gpu_set_texfilter(false);
@ -255,11 +255,11 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
if(_typ == 0) { // free move
var orig = _bne.getHead();
draw_sprite_ext(s_bone_move, 0, _x + _s * orig.x, _y + _s * orig.y, 1, 1, 0, COLORS._main_accent, 1);
draw_sprite_ext(THEME.bone_move, 0, _x + _s * orig.x, _y + _s * orig.y, 1, 1, 0, COLORS._main_accent, 1);
} else if(_typ == 1) { // bone move
var orig = _bne.getTail();
draw_sprite_ext(s_bone_move, 0, _x + _s * orig.x, _y + _s * orig.y, 1, 1, 0, COLORS._main_accent, 1);
draw_sprite_ext(THEME.bone_move, 0, _x + _s * orig.x, _y + _s * orig.y, 1, 1, 0, COLORS._main_accent, 1);
} else if(_typ == 2) { // bone rotate
var orig = _bne.getHead();
@ -271,13 +271,13 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
var _sy = _y + _s * orig.y;
if(point_in_circle(_mx, _my, _sx, _sy, 12)) {
draw_sprite_ext(s_bone_scale, 0, _sx, _sy, 1, 1, _bne.pose_angle, COLORS._main_accent, 1);
draw_sprite_ext(s_bone_rotate, 0, _rx, _ry, 1, 1, _bne.pose_angle, c_white, 1);
draw_sprite_ext(THEME.bone_scale, 0, _sx, _sy, 1, 1, _bne.pose_angle, COLORS._main_accent, 1);
draw_sprite_ext(THEME.bone_rotate, 0, _rx, _ry, 1, 1, _bne.pose_angle, c_white, 1);
_typ = 3;
} else {
draw_sprite_ext(s_bone_scale, 0, _sx, _sy, 1, 1, _bne.pose_angle, c_white, 1);
draw_sprite_ext(s_bone_rotate, 0, _rx, _ry, 1, 1, _bne.pose_angle, COLORS._main_accent, 1);
draw_sprite_ext(THEME.bone_scale, 0, _sx, _sy, 1, 1, _bne.pose_angle, c_white, 1);
draw_sprite_ext(THEME.bone_rotate, 0, _rx, _ry, 1, 1, _bne.pose_angle, COLORS._main_accent, 1);
_typ = 2;
}
}

View file

@ -2749,9 +2749,10 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
if(!active) return;
disable();
PANEL_GRAPH.draw_refresh = true;
array_remove(group == noone? PROJECT.nodes : group.getNodeList(), self);
if(PANEL_GRAPH.node_hover == self) PANEL_GRAPH.node_hover = noone;
if(PANEL_GRAPH.node_hover == self) PANEL_GRAPH.node_hover = noone;
array_remove(PANEL_GRAPH.nodes_selecting, self);
if(PANEL_INSPECTOR.inspecting == self) PANEL_INSPECTOR.inspecting = noone;
@ -2800,6 +2801,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
if(active) return;
enable();
PANEL_GRAPH.draw_refresh = true;
array_push(group == noone? PROJECT.nodes : group.getNodeList(), self);
onRestore();

View file

@ -66,6 +66,9 @@ function Node_Feedback_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) con
}
static drawConnections = function(params = {}) {
if( junc_out == noone || junc_in == noone) return noone;
if(!junc_out.node.active || !junc_in.node.active) return noone;
params.dashed = true; params.loop = true;
drawJuncConnection(junc_out, junc_in, params);
params.dashed = false; params.loop = false;

View file

@ -81,13 +81,13 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
.setCollape(false);
tool_fil8 = [ "Fill", tool_fil8_edit, "fillType", tool_attribute ];
tool_varient_rotate = [ "", new buttonGroup( [ s_canvas_rotate, s_canvas_rotate ], function(v) /*=>*/ { if(tileset != noone) tileset.brush_action_rotate(v) } )
tool_varient_rotate = [ "", new buttonGroup( [ THEME.canvas_rotate, THEME.canvas_rotate ], function(v) /*=>*/ { if(tileset != noone) tileset.brush_action_rotate(v) } )
.setCollape(0)
.setBlend(COLORS._main_icon_light)
.setTooltips([ new tooltipHotkey("Rotate CW", "Node_Tile_Drawer", "Brush Rotate CW"),
new tooltipHotkey("Rotate CCW", "Node_Tile_Drawer", "Brush Rotate CCW")]) ];
tool_varient_flip = [ "", new buttonGroup( [ s_canvas_flip, s_canvas_flip ], function(v) /*=>*/ { if(tileset != noone) tileset.brush_action_flip(v) } )
tool_varient_flip = [ "", new buttonGroup( [ THEME.canvas_flip, THEME.canvas_flip ], function(v) /*=>*/ { if(tileset != noone) tileset.brush_action_flip(v) } )
.setCollape(0)
.setBlend(COLORS._main_icon_light)
.setTooltips([ new tooltipHotkey("Flip H", "Node_Tile_Drawer", "Brush Flip H"),

View file

@ -512,7 +512,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _shov = _hover && point_in_rectangle(_m[0], _m[1], _sx, _sy, _sx + _sw, _sy + _sh);
var _aa = .75 + .25 * _shov;
draw_sprite_stretched_ext(THEME.ui_panel, 1, _sx, _sy, _sw, _sh, COLORS._main_icon, _aa);
draw_sprite_ext(s_flip_h_24, 0, _sx + _sw / 2, _sy + _sh / 2, _fpx? -1 : 1, 1, 0, _fpx? COLORS._main_accent : COLORS._main_icon, _aa);
draw_sprite_ext(THEME.flip_h, 0, _sx + _sw / 2, _sy + _sh / 2, _fpx? -1 : 1, 1, 0, _fpx? COLORS._main_accent : COLORS._main_icon, _aa);
_sx += _sw + ui(8);
if(_shov) {

View file

@ -3536,7 +3536,7 @@ function load_file_path(path, _x = undefined, _y = undefined) {
var is_multi = type == "image" && (array_length(path) > 1 || directory_exists(path[0]));
if(is_multi) {
with(dialogCall(o_dialog_add_multiple_images)) setPath(path);
dialogCall(o_dialog_add_multiple_images).setPath(path);
} else {
if(!IS_CMD) PANEL_GRAPH.onStepBegin();
@ -3552,12 +3552,12 @@ function load_file_path(path, _x = undefined, _y = undefined) {
case "ase" :
case "aseprite" : node = Node_create_ASE_File_Read_path(_x, _y, p); break;
case "png" :
case "jpg" :
case "jpeg" :
if(keyboard_check_direct(vk_shift)) with(dialogCall(o_dialog_add_image)) setPath(p);
else node = Node_create_Image_path(_x, _y, p);
if(keyboard_check_direct(vk_shift)) dialogCall(o_dialog_add_image).setPath(p);
else node = Node_create_Image_path(_x, _y, p);
break;
case "gif" : node = Node_create_Image_gif_path(_x, _y, p); break;