mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 22:54:44 -04:00
Fixed crash when creating a new image and a layer had opacity less than 100%
Caused in CreateNewImage.gd, Global.current_layer = 0 should be under Global.canvas gets set to a new canvas, and after its _ready() method gets executed. The crash occurred when a layer above 0 had transparency less than 100, and a new image was created. _on_OpacitySlider_value_changed() in AnimationTimeline.gd was executed on the old canvas right before it was destroyed, while Global.layers had been cleared. Also removed _on_OpacitySlider_value_changed() from Main.gd, it served no purpose there.
This commit is contained in:
parent
2404798749
commit
3f1c81ac13
4 changed files with 10 additions and 15 deletions
|
@ -307,6 +307,7 @@ func _on_MergeDownLayer_pressed() -> void:
|
|||
Global.undo_redo.add_do_method(Global, "redo", Global.canvases)
|
||||
Global.undo_redo.commit_action()
|
||||
|
||||
|
||||
func _on_OpacitySlider_value_changed(value) -> void:
|
||||
Global.canvas.layers[Global.current_layer][2] = value / 100
|
||||
Global.layer_opacity_slider.value = value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue