From f9315d394c966ef035c300a4f0230fbab798ac77 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Sun, 12 Jul 2026 13:57:32 +0200 Subject: [PATCH] paint: fix first paint --- paint/sources/nodes_brush/brush_output_node.c | 11 +++++------ paint/sources/render/render_path_base.c | 6 ------ paint/sources/ui/ui_base.c | 2 ++ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/paint/sources/nodes_brush/brush_output_node.c b/paint/sources/nodes_brush/brush_output_node.c index 9006b06a..18626716 100644 --- a/paint/sources/nodes_brush/brush_output_node.c +++ b/paint/sources/nodes_brush/brush_output_node.c @@ -116,7 +116,11 @@ void brush_output_node_run() { #endif } - bool first_paint = g_context->last_paint_x < 0 || g_context->last_paint_y < 0; + // First time init + if (g_context->last_paint_x < 0 || g_context->last_paint_y < 0) { + g_context->last_paint_vec_x = g_context->paint_vec.x; + g_context->last_paint_vec_y = g_context->paint_vec.y; + } // Paint bounds if (g_context->paint_vec.x < left || g_context->paint_vec.x > right || g_context->paint_vec.y < top || g_context->paint_vec.y > bottom) { @@ -185,11 +189,6 @@ void brush_output_node_run() { brush_output_node_parse_inputs(); } - if (first_paint) { - g_context->last_paint_vec_x = g_context->paint_vec.x; - g_context->last_paint_vec_y = g_context->paint_vec.y; - } - // Path layer - add point and repaint if (slot_layer_is_path(g_context->layer)) { util_layer_add_path_point(g_context->layer, g_context->paint_vec.x, g_context->paint_vec.y); diff --git a/paint/sources/render/render_path_base.c b/paint/sources/render/render_path_base.c index 7be1af28..c2ea952f 100644 --- a/paint/sources/render/render_path_base.c +++ b/paint/sources/render/render_path_base.c @@ -159,13 +159,7 @@ void render_path_base_commands(void (*draw_commands)(void)) { return; } - if (base_ui_enabled) { - util_layer_check_path_grab(); - util_brush_update(); - } - render_path_base_begin(); - render_path_paint_begin(); render_path_base_draw_split(draw_commands); render_path_base_draw_gbuffer(); diff --git a/paint/sources/ui/ui_base.c b/paint/sources/ui/ui_base.c index f6c4cf2e..ba532e84 100644 --- a/paint/sources/ui/ui_base.c +++ b/paint/sources/ui/ui_base.c @@ -222,6 +222,8 @@ void ui_base_update(void *_) { util_touch_update(); util_stencil_transform(); util_select_update(); + util_layer_check_path_grab(); + util_brush_update(); util_layer_update_preview(); util_shortcut_undo_redo(); util_shortcut_global();