paint: fix first paint
This commit is contained in:
@@ -116,7 +116,11 @@ void brush_output_node_run() {
|
|||||||
#endif
|
#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
|
// 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) {
|
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();
|
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
|
// Path layer - add point and repaint
|
||||||
if (slot_layer_is_path(g_context->layer)) {
|
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);
|
util_layer_add_path_point(g_context->layer, g_context->paint_vec.x, g_context->paint_vec.y);
|
||||||
|
|||||||
@@ -159,13 +159,7 @@ void render_path_base_commands(void (*draw_commands)(void)) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (base_ui_enabled) {
|
|
||||||
util_layer_check_path_grab();
|
|
||||||
util_brush_update();
|
|
||||||
}
|
|
||||||
|
|
||||||
render_path_base_begin();
|
render_path_base_begin();
|
||||||
|
|
||||||
render_path_paint_begin();
|
render_path_paint_begin();
|
||||||
render_path_base_draw_split(draw_commands);
|
render_path_base_draw_split(draw_commands);
|
||||||
render_path_base_draw_gbuffer();
|
render_path_base_draw_gbuffer();
|
||||||
|
|||||||
@@ -222,6 +222,8 @@ void ui_base_update(void *_) {
|
|||||||
util_touch_update();
|
util_touch_update();
|
||||||
util_stencil_transform();
|
util_stencil_transform();
|
||||||
util_select_update();
|
util_select_update();
|
||||||
|
util_layer_check_path_grab();
|
||||||
|
util_brush_update();
|
||||||
util_layer_update_preview();
|
util_layer_update_preview();
|
||||||
util_shortcut_undo_redo();
|
util_shortcut_undo_redo();
|
||||||
util_shortcut_global();
|
util_shortcut_global();
|
||||||
|
|||||||
Reference in New Issue
Block a user