- [Composite] Fix error when resizing surface array.

This commit is contained in:
Tanasart 2024-05-10 07:59:58 +07:00
parent 03e601cbda
commit d461ac15cd
4 changed files with 18 additions and 11 deletions

View File

@ -549,8 +549,8 @@ event_inherited();
} else if(PREFERENCES.dialog_add_node_view == 1) { #region list
var list_width = content_pane.surface_w;
var list_height = ui(28);
var yy = _y + list_height / 2;
var bg_ind = 0;
var yy = _y + list_height / 2;
var bg_ind = 0;
hh += list_height;
for(var i = 0; i < node_count; i++) {

View File

@ -36,10 +36,10 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
LATEST_VERSION = 11600;
VERSION = 11702;
VERSION = 11703;
SAVE_VERSION = 11690;
VERSION_STRING = "1.17.0.2";
BUILD_NUMBER = 11707;
VERSION_STRING = "1.17.0.3";
BUILD_NUMBER = 11708;
globalvar HOTKEYS, HOTKEY_CONTEXT;
HOTKEYS = ds_map_create();

View File

@ -389,6 +389,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
if(inputs[| input_dragging].setValue([ pos_x, pos_y ]))
UNDO_HOLDING = true;
} else if(drag_type == NODE_COMPOSE_DRAG.rotate) {
var aa = point_direction(rot_anc_x, rot_anc_y, _mx, _my);
var da = angle_difference(dragging_mx, aa);
@ -401,11 +402,12 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
if(inputs[| input_dragging].setValue(sa))
UNDO_HOLDING = true;
} else if(drag_type == NODE_COMPOSE_DRAG.scale) {
var _surf = getInputData(surf_dragging + 0);
var _rot = getInputData(surf_dragging + 2);
var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height_safe(_surf);
var _surf = current_data[surf_dragging + 0];
var _rot = current_data[surf_dragging + 2];
var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height_safe(_surf);
var _p = point_rotate(_mx - dragging_mx, _my - dragging_my, 0, 0, -_rot);
var sca_x = _p[0] / _s / _sw * 2;
@ -417,7 +419,8 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
}
if(inputs[| input_dragging].setValue([ sca_x, sca_y ]))
UNDO_HOLDING = true;
UNDO_HOLDING = true;
}
if(mouse_release(mb_left)) {

View File

@ -35,12 +35,14 @@ function Node_MK_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
inputs[| 13] = nodeValue("Edge transform", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_button, [ "Flip", "Rotate" ] );
inputs[| 14] = nodeValue("Sort array by bit", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
input_display_list = [ new Inspector_Sprite(s_MKFX),
["Surfaces", true], 0, 1,
["Tile set", false], 2, 4,
["Edge", false], 5, 12, 13, 10, 11,
["Edge Textures", true], 6, 7, 8, 9,
["Output", false], 3,
["Output", false], 3, 14,
];
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
@ -141,6 +143,7 @@ function Node_MK_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
} #endregion
static step = function() { #region
var _outType = getSingleValue( 3);
var _edgType = getSingleValue( 5);
var _edgFull = getSingleValue(11);
@ -149,6 +152,7 @@ function Node_MK_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
inputs[| 8].setVisible(_edgType == 1, _edgType == 1);
inputs[| 9].setVisible(_edgType == 1, _edgType == 1);
inputs[| 13].setVisible(_edgType == 0);
inputs[| 14].setVisible(_outType == 1);
} #endregion
static generateFull = function(_data, _tex0, _tex1, _edge, _crop, indMain, indEdge_et, indEdge_eb, indEdge_el, indEdge_er) { #region