Skip to content

Commit

Permalink
Fix errors when attempting to draw on a 3D cel
Browse files Browse the repository at this point in the history
Can occur when multiple cels are selected, some of them 3D and some of them pixel
  • Loading branch information
OverloadedOrama committed Mar 28, 2023
1 parent 85be0be commit c2f6bf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Tools/BaseTool.gd
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ func _get_selected_draw_images() -> Array: # Array of Images
var project: Project = Global.current_project
for cel_index in project.selected_cels:
var cel: BaseCel = project.frames[cel_index[0]].cels[cel_index[1]]
if project.layers[cel_index[1]].can_layer_get_drawn():
images.append(cel.get_image())
if not cel is PixelCel:
continue
images.append(cel.get_image())
return images


Expand Down
3 changes: 1 addition & 2 deletions src/UI/Canvas/Selection.gd
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,7 @@ func _get_selected_draw_images() -> Array: # Array of Image(s)
var cel: BaseCel = project.frames[cel_index[0]].cels[cel_index[1]]
if not cel is PixelCel:
continue
if project.layers[cel_index[1]].can_layer_get_drawn():
images.append(cel.image)
images.append(cel.image)
return images


Expand Down

0 comments on commit c2f6bf0

Please sign in to comment.