Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GUI for Cel.opacity on frame changed instead of on layer change #420

Merged
merged 1 commit into from
Jan 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Classes/Project.gd
Original file line number Diff line number Diff line change
Expand Up @@ -465,15 +465,16 @@ func frame_changed(value : int) -> void:
Global.disable_button(Global.move_left_frame_button, frames.size() == 1 or current_frame == 0)
Global.disable_button(Global.move_right_frame_button, frames.size() == 1 or current_frame == frames.size() - 1)

if current_frame < frames.size():
Global.layer_opacity_slider.value = frames[current_frame].cels[current_layer].opacity * 100
Global.layer_opacity_spinbox.value = frames[current_frame].cels[current_layer].opacity * 100

Global.canvas.update()
Global.transparent_checker._ready() # To update the rect size


func layer_changed(value : int) -> void:
current_layer = value
if current_frame < frames.size():
Global.layer_opacity_slider.value = frames[current_frame].cels[current_layer].opacity * 100
Global.layer_opacity_spinbox.value = frames[current_frame].cels[current_layer].opacity * 100

for container in Global.layers_container.get_children():
container.pressed = false
Expand Down