mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Fix "It's not a reference to a valid Image object" error when resizing canvas for the first time
This commit is contained in:
parent
4d85cf1a10
commit
512507e2c7
|
@ -16,10 +16,6 @@ onready var preview_rect : TextureRect = $VBoxContainer/Preview
|
|||
|
||||
|
||||
func _on_ResizeCanvas_about_to_show() -> void:
|
||||
if first_time:
|
||||
width_spinbox.value = Global.current_project.size.x
|
||||
height_spinbox.value = Global.current_project.size.y
|
||||
|
||||
image = Image.new()
|
||||
image.create(Global.current_project.size.x, Global.current_project.size.y, false, Image.FORMAT_RGBA8)
|
||||
image.lock()
|
||||
|
@ -39,7 +35,11 @@ func _on_ResizeCanvas_about_to_show() -> void:
|
|||
layer_i += 1
|
||||
image.unlock()
|
||||
|
||||
update_preview()
|
||||
if first_time:
|
||||
width_spinbox.value = Global.current_project.size.x
|
||||
height_spinbox.value = Global.current_project.size.y
|
||||
else:
|
||||
update_preview()
|
||||
|
||||
|
||||
func _on_ResizeCanvas_confirmed() -> void:
|
||||
|
|
Loading…
Reference in a new issue