1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Update opacity across selected frames (#865)

* Update opacity across selected frames

* Opacity frames update: Remove unnecessary frame poking
This commit is contained in:
20kdc 2023-06-15 11:48:29 +01:00 committed by GitHub
parent a176622b18
commit 51998092d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -867,10 +867,15 @@ func _on_MergeDownLayer_pressed() -> void:
project.undo_redo.commit_action()
func _on_OpacitySlider_value_changed(value) -> void:
var current_frame: Frame = Global.current_project.frames[Global.current_project.current_frame]
var cel: BaseCel = current_frame.cels[Global.current_project.current_layer]
cel.opacity = value / 100
func _on_OpacitySlider_value_changed(value: float) -> void:
var new_opacity := value / 100
var current_layer_idx := Global.current_project.current_layer
# Also update all selected frames.
for idx_pair in Global.current_project.selected_cels:
if idx_pair[1] == current_layer_idx:
var frame: Frame = Global.current_project.frames[idx_pair[0]]
var cel: BaseCel = frame.cels[current_layer_idx]
cel.opacity = new_opacity
Global.canvas.update()