diff --git a/src/UI/Canvas/Selection.gd b/src/UI/Canvas/Selection.gd index 2dd58fec2..da46b4096 100644 --- a/src/UI/Canvas/Selection.gd +++ b/src/UI/Canvas/Selection.gd @@ -472,17 +472,18 @@ func transform_content_confirm() -> void: var frame : int = cel_index[0] var layer : int = cel_index[1] if frame < project.frames.size() and layer < project.layers.size(): - var cel_image : Image = project.frames[frame].cels[layer].image - var src : Image = preview_image - if not is_pasting and not (frame == project.current_frame and layer == project.current_layer): - src = get_selected_image(cel_image, clear_in_selected_cels) - src.resize(big_bounding_rectangle.size.x, big_bounding_rectangle.size.y, Image.INTERPOLATE_NEAREST) - if temp_rect.size.x < 0: - src.flip_x() - if temp_rect.size.y < 0: - src.flip_y() + if Global.current_project.layers[layer].can_layer_get_drawn(): + var cel_image : Image = project.frames[frame].cels[layer].image + var src : Image = preview_image + if not is_pasting and not (frame == project.current_frame and layer == project.current_layer): + src = get_selected_image(cel_image, clear_in_selected_cels) + src.resize(big_bounding_rectangle.size.x, big_bounding_rectangle.size.y, Image.INTERPOLATE_NEAREST) + if temp_rect.size.x < 0: + src.flip_x() + if temp_rect.size.y < 0: + src.flip_y() - cel_image.blit_rect_mask(src, src, Rect2(Vector2.ZERO, project.selection_bitmap.get_size()), big_bounding_rectangle.position) + cel_image.blit_rect_mask(src, src, Rect2(Vector2.ZERO, project.selection_bitmap.get_size()), big_bounding_rectangle.position) var selected_bitmap_copy = project.selection_bitmap.duplicate() project.move_bitmap_values(selected_bitmap_copy) project.selection_bitmap = selected_bitmap_copy diff --git a/src/UI/Timeline/LayerButton.gd b/src/UI/Timeline/LayerButton.gd index 51238cc69..824ead56d 100644 --- a/src/UI/Timeline/LayerButton.gd +++ b/src/UI/Timeline/LayerButton.gd @@ -94,15 +94,18 @@ func save_layer_name(new_name : String) -> void: func _on_VisibilityButton_pressed() -> void: + Global.canvas.selection.transform_content_confirm() Global.current_project.layers[layer].visible = !Global.current_project.layers[layer].visible Global.canvas.update() func _on_LockButton_pressed() -> void: + Global.canvas.selection.transform_content_confirm() Global.current_project.layers[layer].locked = !Global.current_project.layers[layer].locked func _on_LinkButton_pressed() -> void: + Global.canvas.selection.transform_content_confirm() Global.current_project.layers[layer].new_cels_linked = !Global.current_project.layers[layer].new_cels_linked if Global.current_project.layers[layer].new_cels_linked && !Global.current_project.layers[layer].linked_cels: # If button is pressed and there are no linked cels in the layer