-
Notifications
You must be signed in to change notification settings - Fork 65
Description
If you set the isVisible property on a Layer inside a transaction, and then call app.undo(), the visibility change is not reverted.
Example code:
local function revealLayers(layers)
for i, layer in ipairs(layers) do
layer.isVisible = true
if layer.isGroup then
revealLayers(layer.layers)
end
end
end
app.transaction(function()
revealLayers(app.activeSprite.layers)
end)
app.undo() -- This has no effect.
Other actions that act directly on properties are reverted (I tested setting Layer.color instead of Layer.isVisible, for instance).
I suspect this is intentional in that it is consistent with the UI behavior; changing a layer's visibility doesn't seem to be revertable via Edit -> Undo. However, in a scripting context it would be useful to have a revertable visibility change. So if the behavior is intentional, this could be considered a feature request for something like Sprite:setVisibility(visibility, revertable=false), where setting the second parameter to true adds the visibility change to the edit history.