From 67c243b189ea7a47980748cc36e0fe332025bb36 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 11 Mar 2020 01:07:35 +0200 Subject: [PATCH] Fixed issues when creating new image --- Scripts/Dialogs/CreateNewImage.gd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Scripts/Dialogs/CreateNewImage.gd b/Scripts/Dialogs/CreateNewImage.gd index 6ed60781b..f1bd6f920 100644 --- a/Scripts/Dialogs/CreateNewImage.gd +++ b/Scripts/Dialogs/CreateNewImage.gd @@ -9,12 +9,18 @@ func _on_CreateNewImage_confirmed() -> void: var height : int = height_value.value var fill_color : Color = fill_color_node.color Global.control.clear_canvases() + Global.layers.clear() + # Store [Layer name, Layer visibility boolean, Layer lock boolean, Frame container] + Global.layers.append([tr("Layer") + " 0", true, false, HBoxContainer.new()]) + Global.current_layer = 0 Global.canvas = load("res://Prefabs/Canvas.tscn").instance() Global.canvas.size = Vector2(width, height).floor() Global.canvases.append(Global.canvas) Global.canvas_parent.add_child(Global.canvas) + Global.canvases = Global.canvases # To trigger Global.canvases_changed() Global.current_frame = 0 + Global.layers = Global.layers # To trigger Global.layers_changed() if fill_color.a > 0: Global.canvas.layers[0][0].fill(fill_color) Global.canvas.layers[0][0].lock()