- Now we have a view::RealRange (with real frames, fr_t) and a
view::VirtualRange (with virtual frames, columns, col_t). The timeline
uses a virtual range internally and makes the conversion to a real
range when it's appropiated (e.g. to execute an old DocRange operation
using ranges with real frames).
- Added Context::range() to access to the real selected range
instead of accessing directly to the timeline. In this way commands
that were using the DocRange can access to the real range using the
context, instead of the timeline's virtual range.
- Added a new ShowTagTimelineAdapter that can show just one tag in the
timeline filtering out/hiding all other frames/tags.
This already fixes a lot of possible problems that can happen when a
script is running and modifying some part of a sprite that is being
backed up in a background thread.
We still need some work to being able to lock a sprite two or more
times in the same thread to write it. E.g. an app.transaction() should
lock the sprite for write access, but the script transaction function
could call a command, and that command could use a ContextWriter to
lock the sprite again. At the moment this is not possible because we
need a re-entrant RWLock implementation.
* Now a Cel has a z-index property to change the order of layers per frame
* A new doc::RenderPlan class can calculate the order of cels to be rendered
* z-index is saved as a int16_t in the .aseprite files
* This new field can be set/get from Lua with Cel.zIndex
We have to change the range in Timeline before generating a
onActiveSiteChange() so the cel's properties dialog knows the new range
to be used to change the opacity.
Changes:
* With this patch we finally removed the LayerIndex class and member
functions to access layers by index (like Sprite::firstLayer/layerLayer
/layer/indexToLayer/layerToIndex() etc.). As layer groups can be
expanded/collapsed, it doesn't make sense to use layer index to
access layers directly from sprite.
* Now we use a layer_t (int) to access a list of browsable layers each
time we want to iterate visible layers in the timeline.
* Replaced CelsRange() and Sprite::uniqueCels() param with
SelectedFrames to iterate non-adjacent cels.
* Updated clipboard operations (copy/paste) in timeline to support
layer groups.
* Updated Timeline control to support selecting multiple layer/frame
ranges with Ctrl+ or Alt+click (fix#1157)
* Added more test units for DocumentRange operations (mainly for
non-adjacent ranges).
* Enable cel opacity slider when any transparent cel is selected
(it doesn't matter if there are cels from a background layer selected
too, the slider must be enabled for the transparent ones)
* Enable editing user data when we have a range of cels selected
(it doesn't matter if the active cel is nullptr, we've to enable
editing user data if there is any selected cel in the timeline range)