preview outline

This commit is contained in:
Tanasart 2024-12-28 16:07:58 +07:00
parent f1e60b9213
commit 4b7c3d4bb0
3 changed files with 13 additions and 10 deletions

View file

@ -60,7 +60,7 @@ function Node_Gradient(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
input_display_list = [
["Output", true], 0, 8,
["Gradient", false], 1, 15, 5, 12, 9, 13, 7,
["Shape", false], 2, 3, 10, 4, 11, 6, 14, 17,
["Shape", false], 2, 3, 10, 4, 11, 6, 17, 14,
];
attribute_surface_depth();

View file

@ -1116,6 +1116,10 @@ function Panel_Preview() : PanelContent() constructor {
draw_set_color(COLORS.panel_preview_surface_outline);
draw_rectangle(psx, psy, psx + preview_surface_width - 1, psy + preview_surface_height - 1, true);
} else {
draw_set_color_alpha(COLORS.panel_preview_surface_outline, .75);
draw_rectangle(canvas_x, canvas_y, canvas_x + DEF_SURF_W * canvas_s - 1, canvas_y + DEF_SURF_H * canvas_s - 1, true);
draw_set_alpha(1);
}
if(!struct_try_get(_node, "bypass_grid", false)) drawNodeGrid();
@ -2339,8 +2343,7 @@ function Panel_Preview() : PanelContent() constructor {
} else {
dragCanvas();
draw_set_color(COLORS.panel_preview_surface_outline);
draw_set_alpha(.75);
draw_set_color(COLORS.panel_preview_surface_outline, .75);
draw_rectangle(canvas_x, canvas_y, canvas_x + DEF_SURF_W * canvas_s - 1, canvas_y + DEF_SURF_H * canvas_s - 1, true);
draw_set_alpha(1);
}

View file

@ -200,15 +200,15 @@ void main() {
pF1 = point1[i];
pT0 = point2[0];
vec2 f = pointToLine(px, pF0, pF1);
vec2 f = pointToLine(px, pF0, pF1);
float _f = distance(px, f);
float pxx_f1x = (px.x - pF1.x);
float pxy_f1y = (px.y - pF1.y);
float pxx_f0x = (px.x - pF0.x);
float pxy_f0y = (px.y - pF0.y);
float f0y_f1y = (pF0.y - pF1.y);
float f0x_f1x = (pF0.x - pF1.x);
float pxx_f1x = px.x - pF1.x;
float pxy_f1y = px.y - pF1.y;
float pxx_f0x = px.x - pF0.x;
float pxy_f0y = px.y - pF0.y;
float f0y_f1y = pF0.y - pF1.y;
float f0x_f1x = pF0.x - pF1.x;
float dd1 = pxx_f1x * f0y_f1y - f0x_f1x * pxy_f1y;
for(int j = 1; j < subdivision; j++) {