- [Preview Panel] Fix rendering glitch when using UI scale lower than 1.

This commit is contained in:
Tanasart 2024-06-12 18:06:14 +07:00
parent 1d616cfc81
commit b229ecd671
8 changed files with 52 additions and 6 deletions

View file

@ -872,6 +872,7 @@
{"name":"node_mk_flag","order":5,"path":"scripts/node_mk_flag/node_mk_flag.yy",},
{"name":"node_mk_flame","order":7,"path":"scripts/node_mk_flame/node_mk_flame.yy",},
{"name":"node_mk_flare","order":12,"path":"scripts/node_mk_flare/node_mk_flare.yy",},
{"name":"node_mk_fracture","order":15,"path":"scripts/node_mk_fracture/node_mk_fracture.yy",},
{"name":"node_mk_gridflip","order":2,"path":"scripts/node_mk_gridflip/node_mk_gridflip.yy",},
{"name":"node_mk_rain","order":1,"path":"scripts/node_mk_rain/node_mk_rain.yy",},
{"name":"node_mk_saber","order":3,"path":"scripts/node_mk_saber/node_mk_saber.yy",},

View file

@ -1288,6 +1288,7 @@
{"id":{"name":"node_mk_flag","path":"scripts/node_mk_flag/node_mk_flag.yy",},},
{"id":{"name":"node_mk_flame","path":"scripts/node_mk_flame/node_mk_flame.yy",},},
{"id":{"name":"node_mk_flare","path":"scripts/node_mk_flare/node_mk_flare.yy",},},
{"id":{"name":"node_mk_fracture","path":"scripts/node_mk_fracture/node_mk_fracture.yy",},},
{"id":{"name":"node_mk_gridballs","path":"scripts/node_mk_gridballs/node_mk_gridballs.yy",},},
{"id":{"name":"node_mk_gridflip","path":"scripts/node_mk_gridflip/node_mk_gridflip.yy",},},
{"id":{"name":"node_mk_rain","path":"scripts/node_mk_rain/node_mk_rain.yy",},},

View file

@ -202,7 +202,8 @@ function Node_Canvas_Group(_x, _y, _group) : Node_Collection_Inline(_x, _y, _gro
if(_ind == noone)
_ind = composite.input_fix_len;
var _can = composite.inputs[| _ind].value_from;
var _inp = composite.inputs[| _ind];
var _can = _inp? _inp.value_from : noone;
if(_can && struct_has(layers, _can.node.node_id))
canvas_sel = layers[$ _can.node.node_id].canvas;
}

View file

@ -0,0 +1,29 @@
function Node_MK_Fracture(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "MK Fracture";
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
inputs[| 1] = nodeValue("Subdivision", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 4, 4 ])
.setDisplay(VALUE_DISPLAY.vector);
input_display_list = [ new Inspector_Sprite(s_MKFX), 0,
["Fracture", false], 1,
];
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _surf = _data[0];
surface_set_target(_outSurf);
DRAW_CLEAR
surface_reset_target();
return _outSurf;
}
}

View file

@ -0,0 +1,13 @@
{
"$GMScript":"",
"%Name":"node_mk_fracture",
"isCompatibility":false,
"isDnD":false,
"name":"node_mk_fracture",
"parent":{
"name":"MK_effects",
"path":"folders/nodes/data/MK_effects.yy",
},
"resourceType":"GMScript",
"resourceVersion":"2.0",
}

View file

@ -777,6 +777,7 @@ function __initNodes() {
addNodeObject(generator, "MK Blinker", s_node_mk_blinker, "Node_MK_Blinker", [1, Node_MK_Blinker]).setVersion(11630);
addNodeObject(generator, "MK Lens Flare", s_node_mk_flare, "Node_MK_Flare", [1, Node_MK_Flare]).setVersion(11630);
addNodeObject(generator, "MK Delay Machine", s_node_mk_delay_machine, "Node_MK_Delay_Machine", [1, Node_MK_Delay_Machine]).setVersion(11680);
/**/ addNodeObject(generator, "MK Fracture", s_node_mk_delay_machine, "Node_MK_Fracture", [1, Node_MK_Fracture]).setVersion(11740);
//addNodeObject(generator, "MK Sparkle", s_node_mk_sparkle, "Node_MK_Sparkle", [1, Node_MK_Sparkle]).patreonExtra();
#endregion

View file

@ -961,7 +961,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
_hv = true;
draw_circle_ui(_d3x, _d3y, d3_view_wz, _hv? 0 : 0.04, COLORS._main_icon, 0.3);
draw_sprite_ext(THEME.view_pan, 0, _d3x, _d3y, 1, 1, 0, view_pan_tool? COLORS._main_accent : COLORS._main_icon, 1);
draw_sprite_ui(THEME.view_pan, 0, _d3x, _d3y, 1, 1, 0, view_pan_tool? COLORS._main_accent : COLORS._main_icon, 1);
_d3x += (d3_view_wz + ui(4) + d3_view_wz) * _side;
_hv = false;
@ -986,7 +986,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
_hv = true;
draw_circle_ui(_d3x, _d3y, d3_view_wz, _hv? 0 : 0.04, COLORS._main_icon, 0.3);
draw_sprite_ext(THEME.view_zoom, 0, _d3x, _d3y, 1, 1, 0, view_zoom_tool? COLORS._main_accent : COLORS._main_icon, 1);
draw_sprite_ui(THEME.view_zoom, 0, _d3x, _d3y, 1, 1, 0, view_zoom_tool? COLORS._main_accent : COLORS._main_icon, 1);
} #endregion

View file

@ -45,7 +45,7 @@ function Panel_Preview() : PanelContent() constructor {
canvas_x = 0;
canvas_y = 0;
canvas_s = ui(1);
canvas_s = 1;
canvas_w = ui(128);
canvas_h = ui(128);
canvas_a = 0;
@ -1346,7 +1346,7 @@ function Panel_Preview() : PanelContent() constructor {
_hv = true;
draw_circle_ui(_d3x, _d3y, d3_view_wz, _hv? 0 : 0.04, COLORS._main_icon, 0.3);
draw_sprite_ext(THEME.view_zoom, 0, _d3x, _d3y, 1, 1, 0, view_zoom_tool? COLORS._main_accent : COLORS._main_icon, 1);
draw_sprite_ui(THEME.view_zoom, 0, _d3x, _d3y, 1, 1, 0, view_zoom_tool? COLORS._main_accent : COLORS._main_icon, 1);
} else {
var d3_view_wz = ui(16);
@ -1375,7 +1375,7 @@ function Panel_Preview() : PanelContent() constructor {
_hv = true;
draw_circle_ui(_d3x, _d3y, d3_view_wz, _hv? 0 : 0.04, COLORS._main_icon, 0.3);
draw_sprite_ext(THEME.view_pan, 0, _d3x, _d3y, 1, 1, 0, view_pan_tool? COLORS._main_accent : COLORS._main_icon, 1);
draw_sprite_ui(THEME.view_pan, 0, _d3x, _d3y, 1, 1, 0, view_pan_tool? COLORS._main_accent : COLORS._main_icon, 1);
_d3x += (d3_view_wz + ui(4) + d3_view_wz) * _side;
_d3y = _view_y + d3_view_wz;