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

Hide invisible layers in onion skinning

This commit is contained in:
OverloadedOrama 2020-02-20 01:35:12 +02:00
parent 29959a410a
commit 37621477c8

View file

@ -85,9 +85,12 @@ func _draw() -> void:
color = Color.white
for i in range(1, Global.onion_skinning_past_rate + 1):
if Global.current_frame >= i:
var layer_i := 0
for layer in Global.canvases[Global.current_frame - i].layers:
color.a = 0.6/i
draw_texture(layer[1], location, color)
if Global.layers[layer_i][1]: # If it's visible
color.a = 0.6 / i
draw_texture(layer[1], location, color)
layer_i += 1
# Future
if Global.onion_skinning_future_rate > 0:
@ -98,9 +101,12 @@ func _draw() -> void:
color = Color.white
for i in range(1, Global.onion_skinning_future_rate + 1):
if Global.current_frame < Global.canvases.size() - i:
var layer_i := 0
for layer in Global.canvases[Global.current_frame + i].layers:
color.a = 0.6/i
draw_texture(layer[1], location, color)
if Global.layers[layer_i][1]: # If it's visible
color.a = 0.6 / i
draw_texture(layer[1], location, color)
layer_i += 1
# Draw current frame layers
for i in range(layers.size()):