mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-05-06 21:04:50 -04: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
1 changed files with 5 additions and 5 deletions
|
@ -16,10 +16,6 @@ onready var preview_rect : TextureRect = $VBoxContainer/Preview
|
||||||
|
|
||||||
|
|
||||||
func _on_ResizeCanvas_about_to_show() -> void:
|
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 = Image.new()
|
||||||
image.create(Global.current_project.size.x, Global.current_project.size.y, false, Image.FORMAT_RGBA8)
|
image.create(Global.current_project.size.x, Global.current_project.size.y, false, Image.FORMAT_RGBA8)
|
||||||
image.lock()
|
image.lock()
|
||||||
|
@ -39,7 +35,11 @@ func _on_ResizeCanvas_about_to_show() -> void:
|
||||||
layer_i += 1
|
layer_i += 1
|
||||||
image.unlock()
|
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:
|
func _on_ResizeCanvas_confirmed() -> void:
|
||||||
|
|
Loading…
Add table
Reference in a new issue