1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-22 05:23:14 +00:00

Cloned frames are now automatically part of the tag

The tags don't work with UndoRedo yet, so this is not final behavior
This commit is contained in:
OverloadedOrama 2020-04-17 04:59:23 +03:00
parent 699dfbe091
commit 954b6111c2
2 changed files with 9 additions and 4 deletions

View file

@ -102,6 +102,12 @@ func _on_CopyFrame_pressed(frame := -1) -> void:
tex.create_from_image(sprite, 0) tex.create_from_image(sprite, 0)
new_canvas.layers.append([sprite, tex, layer[2]]) new_canvas.layers.append([sprite, tex, layer[2]])
# Loop through the tags to see if the frame is in one
for tag in Global.animation_tags:
if frame + 1 >= tag[2] && frame + 1 <= tag[3]:
tag[3] += 1
Global.animation_tags = Global.animation_tags # To execute animation_tags_changed()
Global.undos += 1 Global.undos += 1
Global.undo_redo.create_action("Add Frame") Global.undo_redo.create_action("Add Frame")
Global.undo_redo.add_do_method(Global, "redo", [new_canvas]) Global.undo_redo.add_do_method(Global, "redo", [new_canvas])

View file

@ -1013,7 +1013,6 @@ func blend_rect(bg : Image, brush : Image, src_rect : Rect2, dst : Vector2) -> v
brush.unlock() brush.unlock()
func adjust_hsv(img: Image, id : int, delta : float) -> void: func adjust_hsv(img: Image, id : int, delta : float) -> void:
var selection_only : bool = !Global.selected_pixels.empty()
var layer : Image = img var layer : Image = img
layer.lock() layer.lock()
match id: match id: