diff --git a/src/Canvas.gd b/src/Canvas.gd index 989c4cdc3..27458bd07 100644 --- a/src/Canvas.gd +++ b/src/Canvas.gd @@ -246,9 +246,9 @@ func camera_zoom() -> void: Global.transparent_checker._ready() # To update the rect size -func new_empty_frame(first_time := false) -> Frame: +func new_empty_frame(first_time := false, single_layer := false) -> Frame: var frame := Frame.new() - for l in Global.current_project.layers: + for l in Global.current_project.layers: # Create as many cels as there are layers # The sprite itself var sprite := Image.new() if first_time: @@ -263,6 +263,9 @@ func new_empty_frame(first_time := false) -> Frame: sprite.lock() frame.cels.append(Cel.new(sprite, 1)) + if single_layer: + break + return frame diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index fa76fe75f..ff5fae4ab 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -117,6 +117,7 @@ func change_project() -> void: Global.create_brush_button(brush) Global.canvas.update() + Global.transparent_checker._ready() func frames_changed(value : Array) -> void: diff --git a/src/UI/Dialogs/CreateNewImage.gd b/src/UI/Dialogs/CreateNewImage.gd index f5bfee101..316a64b39 100644 --- a/src/UI/Dialogs/CreateNewImage.gd +++ b/src/UI/Dialogs/CreateNewImage.gd @@ -74,7 +74,7 @@ func _on_CreateNewImage_confirmed() -> void: var height : int = height_value.value var fill_color : Color = fill_color_node.color - var frame : Frame = Global.canvas.new_empty_frame() + var frame : Frame = Global.canvas.new_empty_frame(false, true) Global.projects.append(Project.new([frame])) Global.tabs.current_tab = Global.tabs.get_tab_count() - 1 Global.current_project.size = Vector2(width, height).floor()