paint: fix first paint

This commit is contained in:
luboslenco
2026-07-12 11:28:31 +02:00
parent a318ba1430
commit 425e2a5065
@@ -116,11 +116,7 @@ void brush_output_node_run() {
#endif
}
// 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;
}
bool first_paint = g_context->last_paint_x < 0 || g_context->last_paint_y < 0;
// 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) {
@@ -189,6 +185,11 @@ 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);