[AreaBox] Fix converting to padding type swap left and right values.

This commit is contained in:
Tanasart 2025-02-26 15:19:10 +07:00
parent 57dfbc66dd
commit 3e30c496a5
9 changed files with 31 additions and 36 deletions

Binary file not shown.

View file

@ -159,9 +159,9 @@ function areaBox(_onModify, _unit = noone) : widget() constructor {
break; break;
case AREA_MODE.padding : case AREA_MODE.padding :
onModify(x0, 0); onModify(ss[0] - x1, 0);
onModify(y0, 1); onModify(y0, 1);
onModify(ss[0] - x1, 2); onModify(x0, 2);
onModify(ss[1] - y1, 3); onModify(ss[1] - y1, 3);
break; break;
@ -232,6 +232,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor {
onModify(cnvt? 0.5 : ss[0] / 2, 2); onModify(cnvt? 0.5 : ss[0] / 2, 2);
onModify(cnvt? 0.5 : ss[1] / 2, 3); onModify(cnvt? 0.5 : ss[1] / 2, 3);
break; break;
case AREA_MODE.padding : case AREA_MODE.padding :
var ss = onSurfaceSize(); var ss = onSurfaceSize();
onModify(0, 0); onModify(0, 0);
@ -239,6 +240,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor {
onModify(0, 2); onModify(0, 2);
onModify(0, 3); onModify(0, 3);
break; break;
case AREA_MODE.two_point : case AREA_MODE.two_point :
var ss = onSurfaceSize(); var ss = onSurfaceSize();
onModify(0, 0); onModify(0, 0);

View file

@ -43,8 +43,8 @@
LATEST_VERSION = 1_18_00_0; LATEST_VERSION = 1_18_00_0;
VERSION = 1_18_09_0; VERSION = 1_18_09_0;
SAVE_VERSION = 1_18_09_1; SAVE_VERSION = 1_18_09_1;
VERSION_STRING = MAC? "1.18.003m" : "1.18.9.1.001"; VERSION_STRING = MAC? "1.18.003m" : "1.18.10.001";
BUILD_NUMBER = 118091.001; BUILD_NUMBER = 118101.001;
PREF_VERSION = 1_17_1; PREF_VERSION = 1_17_1;
var _vsp = string_split(VERSION_STRING, "."); var _vsp = string_split(VERSION_STRING, ".");

View file

@ -345,6 +345,11 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
if(will_refresh) refreshNodes(); if(will_refresh) refreshNodes();
doStepBegin(); doStepBegin();
if(toRefreshNodeDisplay) {
refreshNodeDisplay();
toRefreshNodeDisplay = false;
}
} }
static step = function() { static step = function() {

View file

@ -792,7 +792,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
inputDisplayList = []; inputDisplayList = [];
var iamo = getInputAmount(); var iamo = getInputAmount();
if(iamo && input_display_dynamic != -1) { if(input_display_dynamic != -1 && iamo) {
for(var i = 0; i < array_length(input_display_list_raw); i++) { for(var i = 0; i < array_length(input_display_list_raw); i++) {
var ind = input_display_list_raw[i]; var ind = input_display_list_raw[i];
@ -823,7 +823,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
} else { } else {
var amo = input_display_list == -1? array_length(inputs) : array_length(input_display_list); var amo = input_display_list == -1? array_length(inputs) : array_length(input_display_list);
// print($"Amo = {amo}");
for(var i = 0; i < amo; i++) { for(var i = 0; i < amo; i++) {
var ind = getInputJunctionIndex(i); var ind = getInputJunctionIndex(i);
@ -831,21 +830,13 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
var jun = array_safe_get(inputs, ind, noone); var jun = array_safe_get(inputs, ind, noone);
if(jun == noone || is_undefined(jun)) continue; if(jun == noone || is_undefined(jun)) continue;
// print($"{i}: {jun.isVisible()}");
// print($" {jun.visible_manual}, {jun.visible}, {jun.index}, {jun.visible_in_list}");
if(!jun.isVisible()) continue; if(!jun.isVisible()) continue;
array_push(inputDisplayList, jun); array_push(inputDisplayList, jun);
} }
// print($"{inputDisplayList}\n");
} }
if(auto_input && dummy_input) array_push(inputDisplayList, dummy_input); if(auto_input && dummy_input) array_push(inputDisplayList, dummy_input);
// print(inputDisplayList);
} }
static onValidate = function() { static onValidate = function() {
@ -1467,6 +1458,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
} }
static refreshNodeDisplay = function() { static refreshNodeDisplay = function() {
updateIO(); updateIO();
setHeight(); setHeight();
getJunctionList(); getJunctionList();

View file

@ -115,7 +115,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
newInput(12, nodeValue_Vec2("Gizmo Position", self, [ 0, 0 ])); newInput(12, nodeValue_Vec2("Gizmo Position", self, [ 0, 0 ]));
newInput(13, nodeValue_Vec2("Gizmo Scale", self, 1)); newInput(13, nodeValue_Float("Gizmo Scale", self, 1));
inputs[10].setFrom_condition = function(_valueFrom) { inputs[10].setFrom_condition = function(_valueFrom) {
if(is_instanceof(_valueFrom.node, Node_Group_Input)) return true; if(is_instanceof(_valueFrom.node, Node_Group_Input)) return true;
@ -246,14 +246,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
case 7 : _vis = _val <= _vto; break; case 7 : _vis = _val <= _vto; break;
} }
var _v = inParent.visible; inParent.setVisible(_vis, _vis);
if(_v && !_vis) inParent.visible = false;
inParent.show_in_inspector = _vis;
if(_v != _vis) {
group.setHeight();
group.getJunctionList();
}
} }
static onValueUpdate = function(index = 0) { static onValueUpdate = function(index = 0) {
@ -495,6 +488,8 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
__data = noone; __data = noone;
static update = function(frame = CURRENT_FRAME) { static update = function(frame = CURRENT_FRAME) {
visibleCheck();
if(!is(inParent, NodeValue)) return; if(!is(inParent, NodeValue)) return;
outputs[0].setValue(inParent.getValue()); outputs[0].setValue(inParent.getValue());

View file

@ -205,6 +205,18 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
} }
if(_posMode == 0) {
hv = inputs[3].drawOverlay(_int, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= hv; _int &= !_hov;
} else if(_posMode == 1) {
_px = _x + _pos[0] * _s;
_py = _y + _pos[1] * _s;
hv = inputs[16].drawOverlay(_int, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= hv; _int &= !_hov;
hv = inputs[17].drawOverlay(_int, active, _px, _py, _s, _mx, _my, _snx, _sny); _hov |= hv; _int &= !_hov;
}
if(inputs[9].show_in_inspector && _posMode != 2) { // corner if(inputs[9].show_in_inspector && _posMode != 2) { // corner
var _px = _x + _pos[0] * _s; var _px = _x + _pos[0] * _s;
var _py = _y + _pos[1] * _s; var _py = _y + _pos[1] * _s;
@ -234,18 +246,6 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
hv = inputs[9].drawOverlay(_int, active, _x0, _y0, _s, _mx, _my, _snx, _sny, aa, _max_s, 1); _hov |= hv; _int &= !_hov; hv = inputs[9].drawOverlay(_int, active, _x0, _y0, _s, _mx, _my, _snx, _sny, aa, _max_s, 1); _hov |= hv; _int &= !_hov;
} }
if(_posMode == 0) {
hv = inputs[3].drawOverlay(_int, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= hv; _int &= !_hov;
} else if(_posMode == 1) {
_px = _x + _pos[0] * _s;
_py = _y + _pos[1] * _s;
hv = inputs[16].drawOverlay(_int, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= hv; _int &= !_hov;
hv = inputs[17].drawOverlay(_int, active, _px, _py, _s, _mx, _my, _snx, _sny); _hov |= hv; _int &= !_hov;
}
return _hov; return _hov;
} }

View file

@ -558,6 +558,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
} }
if(value_from) return true; if(value_from) return true;
if(!show_in_inspector) return false;
if(visible_manual != 0) return visible_manual == 1; if(visible_manual != 0) return visible_manual == 1;
if(!visible) return false; if(!visible) return false;
if(index == -1) return true; if(index == -1) return true;

View file

@ -856,7 +856,7 @@ function Panel_Animation() : PanelContent() constructor {
} }
} }
if(pHOVER && point_in_rectangle(mx, my, bar_x, 8, bar_x + bar_w, 8 + 16)) { //top bar if(pHOVER && point_in_rectangle(mx, my, bar_x, ui(8), bar_x + bar_w, ui(8 + 16))) { //top bar
if(mx < bar_int_x && mouse_press(mb_left, pFOCUS) && timeline_draggable) { if(mx < bar_int_x && mouse_press(mb_left, pFOCUS) && timeline_draggable) {
timeline_scubbing = true; timeline_scubbing = true;
timeline_scub_st = CURRENT_FRAME; timeline_scub_st = CURRENT_FRAME;