1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 01:29:49 +00:00

Fix bug where, if the bottom-most layer is invisible, selection can't transform content on other layers

This commit is contained in:
Emmanouil Papadeas 2023-03-27 03:42:16 +03:00
parent 6b587688f1
commit 5c9f0d8c18

View file

@ -417,17 +417,15 @@ func blend_all_layers(
func blend_selected_cels( func blend_selected_cels(
image: Image, frame: Frame, origin := Vector2(0, 0), project := Global.current_project image: Image, frame: Frame, origin := Vector2(0, 0), project := Global.current_project
) -> void: ) -> void:
var layer_i := 0
for cel_ind in frame.cels.size(): for cel_ind in frame.cels.size():
var test_array := [project.current_frame, cel_ind] var test_array := [project.current_frame, cel_ind]
if not test_array in project.selected_cels: if not test_array in project.selected_cels:
continue continue
if not frame.cels[cel_ind] is PixelCel: if not frame.cels[cel_ind] is PixelCel:
continue continue
if not project.layers[cel_ind].is_visible_in_hierarchy():
continue
var cel: PixelCel = frame.cels[cel_ind] var cel: PixelCel = frame.cels[cel_ind]
if project.layers[layer_i].is_visible_in_hierarchy():
var cel_image := Image.new() var cel_image := Image.new()
cel_image.copy_from(cel.image) cel_image.copy_from(cel.image)
if cel.opacity < 1: # If we have cel transparency if cel.opacity < 1: # If we have cel transparency
@ -441,7 +439,6 @@ func blend_selected_cels(
) )
cel_image.unlock() cel_image.unlock()
image.blend_rect(cel_image, Rect2(Vector2.ZERO, project.size), origin) image.blend_rect(cel_image, Rect2(Vector2.ZERO, project.size), origin)
layer_i += 1
func frames_divided_by_spritesheet_lines() -> int: func frames_divided_by_spritesheet_lines() -> int: