Moved size variable from Canvas.gd to Project.gd

This commit is contained in:
OverloadedOrama 2020-06-04 23:20:20 +03:00
parent 4e111a7ac0
commit f9bd590d20
16 changed files with 79 additions and 73 deletions

View file

@ -341,7 +341,7 @@ func add_layer(is_new := true) -> void:
for f in Global.current_project.frames:
var new_layer := Image.new()
if is_new:
new_layer.create(Global.canvas.size.x, Global.canvas.size.y, false, Image.FORMAT_RGBA8)
new_layer.create(Global.current_project.size.x, Global.current_project.size.y, false, Image.FORMAT_RGBA8)
else: # Clone layer
new_layer.copy_from(f.cels[Global.current_project.current_layer].image)
@ -440,7 +440,7 @@ func _on_MergeDownLayer_pressed() -> void:
var new_layer := Image.new()
new_layer.copy_from(f.cels[Global.current_project.current_layer - 1].image)
new_layer.lock()
DrawingAlgos.blend_rect(new_layer, selected_layer, Rect2(Global.canvas.location, Global.canvas.size), Vector2.ZERO)
DrawingAlgos.blend_rect(new_layer, selected_layer, Rect2(Global.canvas.location, Global.current_project.size), Vector2.ZERO)
new_cels.remove(Global.current_project.current_layer)
if !selected_layer.is_invisible() and Global.current_project.layers[Global.current_project.current_layer - 1].linked_cels.size() > 1 and (f in Global.current_project.layers[Global.current_project.current_layer - 1].linked_cels):
new_layers[Global.current_project.current_layer - 1].linked_cels.erase(f)