mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 06:26:42 +01:00
- [Graph Panel] Fix auto connection conect wrong junctions.
This commit is contained in:
parent
a0a1941159
commit
734c96890c
4 changed files with 23 additions and 11 deletions
|
@ -191,7 +191,10 @@
|
|||
case ".png" :
|
||||
case ".jpg" :
|
||||
case ".jpeg" :
|
||||
node = Node_create_Image_path(_x, _y, p);
|
||||
if(key_mod_press(SHIFT))
|
||||
node = Node_create_Image_path(_x, _y, p);
|
||||
else
|
||||
node = Node_create_Image_path(_x, _y, p);
|
||||
break;
|
||||
|
||||
case ".gif" :
|
||||
|
|
|
@ -503,11 +503,13 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
|
||||
static getInput = function(junc = noone, shift = input_fix_len) { #region
|
||||
for( var i = shift; i < ds_list_size(inputs); i++ ) {
|
||||
if(!inputs[| i].visible) continue;
|
||||
if(inputs[| i].value_from != noone) continue;
|
||||
if(junc != noone && !inputs[| i].isConnectable(junc, true)) continue;
|
||||
var _inp = inputs[| i];
|
||||
|
||||
return inputs[| i];
|
||||
if(!_inp.visible) continue;
|
||||
if(_inp.value_from != noone) continue;
|
||||
if(junc != noone && (value_bit(junc.type) & value_bit(_inp.type)) == 0) continue;
|
||||
|
||||
return _inp;
|
||||
}
|
||||
return noone;
|
||||
} #endregion
|
||||
|
|
|
@ -220,9 +220,14 @@ function Panel_File_Explorer() : PanelContent() constructor {
|
|||
nodeBuild("Node_Canvas", _graph_x, _graph_y).loadImagePath(__menu_file_selecting.path);
|
||||
}),
|
||||
|
||||
menuItem("Copy path", function() { clipboard_set_text(__menu_file_selecting.path); }, THEME.copy),
|
||||
];
|
||||
|
||||
menu_file_project = [ menuItem("Open", function() { LOAD_AT(__menu_file_selecting.path); }), ];
|
||||
menu_file_project = [
|
||||
menuItem("Open", function() { LOAD_AT(__menu_file_selecting.path); }),
|
||||
|
||||
menuItem("Copy path", function() { clipboard_set_text(__menu_file_selecting.path); }, THEME.copy),
|
||||
];
|
||||
|
||||
menu_general = [ menuItem("Refresh", function() { if(rootFile) rootFile.getContent() }), ];
|
||||
#endregion
|
||||
|
@ -365,11 +370,11 @@ function Panel_File_Explorer() : PanelContent() constructor {
|
|||
var _ppw = _pw;
|
||||
|
||||
if(point_in_rectangle(_m[0], _m[1], _px, _py, _px + _pw, _py + _ph)) {
|
||||
if(buttonInstant(THEME.button_hide, _px + _ppw - _ph, _py, _ph, _ph, _m, pFOCUS, pHOVER, "", THEME.path_open_20) == 2)
|
||||
if(buttonInstant(THEME.button_hide, _px + _ppw - _ph, _py, _ph, _ph, _m, pFOCUS, pHOVER, "Set as root", THEME.path_open_20) == 2)
|
||||
setRoot(_dir.path);
|
||||
_ppw -= _ph + ui(2);
|
||||
|
||||
if(buttonInstant(THEME.button_hide, _px + _ppw - _ph, _py, _ph, _ph, _m, pFOCUS, pHOVER, "", THEME.copy_20) == 2)
|
||||
if(buttonInstant(THEME.button_hide, _px + _ppw - _ph, _py, _ph, _ph, _m, pFOCUS, pHOVER, "Copy path", THEME.copy_20) == 2)
|
||||
clipboard_set_text(_dir.path);
|
||||
_ppw -= _ph + ui(2);
|
||||
|
||||
|
@ -469,7 +474,8 @@ function Panel_File_Explorer() : PanelContent() constructor {
|
|||
if(contentPane.hover && point_in_rectangle(_m[0], _m[1], _px, _py, _px + _tw, _py + _ph)) {
|
||||
if(!mouse_click(mb_left)) {
|
||||
draw_sprite_stretched_ext(THEME.ui_panel_fg, 1, _px, _py, _tw, _ph, COLORS._main_icon_light, 1);
|
||||
TOOLTIP = [ _th, "sprite" ];
|
||||
if(!instance_exists(o_dialog_menubox))
|
||||
TOOLTIP = [ _th, "sprite" ];
|
||||
}
|
||||
|
||||
file_hovering = _fil;
|
||||
|
@ -546,7 +552,8 @@ function Panel_File_Explorer() : PanelContent() constructor {
|
|||
if(contentPane.hover && point_in_rectangle(_m[0], _m[1], _px, _py, _px + _pw, _py + _ph)) {
|
||||
if(!mouse_click(mb_left)) {
|
||||
draw_sprite_stretched_ext(THEME.ui_panel_fg, 1, _px, _py, _pw, _ph, COLORS._main_icon_light, 1);
|
||||
TOOLTIP = [ _th, "sprite" ];
|
||||
if(!instance_exists(o_dialog_menubox))
|
||||
TOOLTIP = [ _th, "sprite" ];
|
||||
}
|
||||
|
||||
file_hovering = _fil;
|
||||
|
|
|
@ -1398,7 +1398,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
if(target != noone)
|
||||
node_hovering.active_draw_index = 1;
|
||||
} else {
|
||||
target = node_hovering.getInput(value_dragging);
|
||||
target = node_hovering.getInput(value_dragging, 0);
|
||||
if(target != noone)
|
||||
node_hovering.active_draw_index = 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue