paint: path layer fixes
This commit is contained in:
@@ -461,6 +461,11 @@ void slot_layer_to_fill_layer(slot_layer_t *raw) {
|
||||
void slot_layer_to_paint_layer(slot_layer_t *raw) {
|
||||
context_set_layer(raw);
|
||||
raw->fill_material = NULL;
|
||||
if (raw->path_material != NULL) {
|
||||
raw->path_material = NULL;
|
||||
raw->path_points = NULL;
|
||||
util_layer_update_path();
|
||||
}
|
||||
make_material_parse_paint_material(true);
|
||||
g_context->layer_preview_dirty = true;
|
||||
ui_base_hwnds->buffer[TAB_AREA_SIDEBAR0]->redraws = 2;
|
||||
|
||||
@@ -666,11 +666,12 @@ void tab_layers_draw_layer_context_menu_draw() {
|
||||
if (!slot_layer_is_group(l)) {
|
||||
char *to_fill_string = slot_layer_is_layer(l) ? tr("To Fill Layer") : tr("To Fill Mask");
|
||||
char *to_paint_string = slot_layer_is_layer(l) ? tr("To Paint Layer") : tr("To Paint Mask");
|
||||
bool fill_layer = l->fill_material != NULL || l->path_material != NULL;
|
||||
|
||||
if (l->fill_material == NULL && ui_menu_button(to_fill_string, "", ICON_SPHERE)) {
|
||||
if (!fill_layer && ui_menu_button(to_fill_string, "", ICON_SPHERE)) {
|
||||
sys_notify_on_next_frame(&tab_layers_draw_layer_context_menu_to_fill_layer, NULL);
|
||||
}
|
||||
if (l->fill_material != NULL && ui_menu_button(to_paint_string, "", ICON_PAINT)) {
|
||||
if (fill_layer && ui_menu_button(to_paint_string, "", ICON_PAINT)) {
|
||||
sys_notify_on_next_frame(&tab_layers_draw_layer_context_menu_to_paint_layer, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ void util_layer_update_path() {
|
||||
bool is_path = slot_layer_is_path(l);
|
||||
|
||||
// Clear spheres when switching away from path layer
|
||||
if (path_layer_current != l) {
|
||||
if (path_layer_current != l || !is_path) {
|
||||
path_destroy_spheres();
|
||||
path_point_dragging = -1;
|
||||
path_layer_current = is_path ? l : NULL;
|
||||
|
||||
Reference in New Issue
Block a user