paint: fix first paint

This commit is contained in:
luboslenco
2026-07-12 13:57:32 +02:00
parent 107abf2ed0
commit f9315d394c
3 changed files with 7 additions and 12 deletions
@@ -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);
-6
View File
@@ -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();
+2
View File
@@ -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();