Without this an exception in DelayedMouseMove::commitMouseMove() could
produce (e.g.) the crash in #3818. This same error handling was
already done for Editor::onProcessMessage() in
DocView::onProcessMessage() to avoid crashing due unhandled exceptions
in Editor message processing.
Regression introduced with 8722c8ec16
and d3562b140c.
Our re-entrant RWLock implementation is tricky because it doesn't
support to unlock in different order than it was locked.
E.g. If we create a DocWriter (e.g. paste command), and try to create
a DocReader (e.g. PixelsMovement) inside the DocWriter scope, the
reader will return a LockResult::Reentrant, but if we unlock the
write, then the reader cannot be used to upgradeToWrite() because the
lock will have just 0 locks (the re-entrant one didn't modify the
count of the RWLock). This is because it was thought that the
DocReader was going to be unlocked before the writer lock (in the
exact inverse order).
Basically these re-entrant RWLocks will not work fine if we mix up the
order of locks/unlocks in the same thread.
With re-entrant RWLocks we can try to lock the document on each
transaction/command/modification. This fixes several problems running
scripts that weren't locking the sprite in an app.transaction() call.
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.
Given error:
Could not parse translation base file: File contains no section
headers. file: '<???>', line: 10 'display_name = English\n'
It looks like a known issue: https://github.com/WeblateOrg/weblate/issues/9702
Without this fix a recovering thread could get stuck in an infinite loop when reading the slices of a sprite created with a doc format version lesser than 2.
This fixes a problem where the smaller brush size of the dynamics was
used for tools like line/rectangle/etc. where the dynamics option
aren't used.
We've added some comments for a possible future #4186 too,
implementing dynamics for the contour tool (which is freehand, but the
result is filled).
We were loading the whole list of dithering matrices on each mouse
move now just by chance. As a future refactor we should improve the
handling of dynamics options, e.g. avoid accessing preferences/
rebuilding the tools::DynamicsOptions object on each mouse movement.
We are not sure, but due to new bug reports about a lagging mouse
movement (#4174), it might be because some memory cache issues: having
the rows array at the end of the pixels data might not be the best
decision.
It was moved at the end because we didn't need that rows array to be
aligned, only the pixels data. But with this patch we're trying to see
if this fixes the issue. So now we moved back the rows array at the
beginning of the image buffer as it was before aeeef8e255
On Apple Silicon we can hide "-arm64", and on PCs we can hide "-x64".
For Intel chips on Mac we'll show "(x64)" suffix, and on PCs we'll
show "(x86)" for 32-bit version.
By default Aseprite will not try to match flipped versions of the
tiles (as it requires more CPU), but when we create a tileset we can
specify which flips can be matched automatically (new
Tileset::matchFlags() property).
These flags are just for the Auto mode, if we manually insert a
flipped tile, that is always supported, even when the matchFlags() are
not specified.
The assert() in remove_unused_tiles_from_tileset() checking for the
tiles histograms was failing because we weren't adjusting the
histogram correctly when a tile w/a flag is replaced w/another without
flags.
* Added a new app::Color type for tiles, to store the flags of the
picked tile.
* Fixed color bar/status bar with a new draw_tile() to draw tiles
with flip flags.
Something interesting is that Image:drawPixel() must ask for a rehash
to the tileset when the tile is modified, maybe we can find a better
way to handle this in the future.
* Changed the "90cw" flag to "diagonal flip" (the tile should be
rendered with X/Y axis switched in this case)
* Each time we read/write an .aseprite file we have to convert
the mask/shift from the file to the values expected in
memory (tile_f_xflip/yflip/dflip)
Changed the required size to its minimum (6 instead of 8).
Minor refactor from 1c3224a716
All these values are hard-coded in DitherItem (so we cannot use
theme-related values yet for this).
Added offset to dithering selector dropdown width to avoid X dimension scrollbar obscuring the bottom of the dropdown. This also removes the need for a vertical scrollbar for the generic number of dithering options.
Related to Issue #4001
If the sprite contained only one layer group, and we tried to delete
one child, we got an error message about "You cannot delete all
layers". This fixes this (the error message is only when we delete the
last top level layer).
E.g. If we configure Shift+scroll wheel to "Change Layer" action, and
Shift+J to delete a layer, we can press Shift key and move through
layers with the mouse whell while we press the Shift key, and if we
press J (without releasing the Shift) start deleting layers. At some
point a crash will happen.
This change was introduced in dd7e27a098
as a possible fix for #4024, but the change is too disruptive to be
introduced at this stage, we need some extra UI elements to make the
drag & drop accessible in both modes: the default v1.2 behavior, and
a possible new selection mode, e.g. #1498
As now the native file selector is the default one, we moved the
option to re-enable the previous file selector to Edit > Preferences >
General > Show Aseprite file dialog option.
Related to #3615 and added as a simple alternative to #2745 which
require native widgets on each native file dialog.
Prior to this fix, border padding was clipped to the edge of sprites
on the right and bottom in all export sprite sheet types.
This commit includes tests for 'Export Sprite Sheet' command using
shape padding, border padding, inner padding with 'Packed' sheet type
+ 'Trim Cels' = true.
Before this fix, when the thumbnail size was 1, the "Toggle Timeline
Thumbnails" command (F6 key) seemed to not work until we changed
the timeline thumbnail size to 2 or more.
Now:
1) If some dynamics are set and the "Same on all tools" box is
unchecked, when we check it, aseprite will copy the active
configuration as shared values.
2) If "Same on all tools" is checked, and we uncheck it, aseprite
will copy shared values to the active tool settings (without touching
other tools), in this way the visible options of the active tool
won't be modified.
Now a single click will not enable the range, using Shift+click or
dragging the mouse will enable the range of multiple
layers/frames/cels by default (but there are new options to go back to
the previous behavior or customize this behavior in an extensive way).
Regression added in 056073b3f1 in the
custom file selector. Every time you saved a new sprite the dialog
started at the root path (e.g. Desktop) instead of the last used
directory.
Now each tool has independent 'dynamic options'. A global configuration
for all tools is also possible via the 'Same in all tools' option.
ALso this fix, solves a regression inserted in:
2cc15cda9e
(bug inserted: stabilizer is always active)
This fix disables the fine control when the transformation doesn't
include rotation, skew and/or fine scaling (so just translating doesn't
allow fine control until we rotate/skew/scaling, this might change in
the future if we add a new anti-aliasing rotation algorithm).
Also this fix improves the regular movement of the selected image.
This patch solves several problems introducing the possibility to
specify a row stride bigger than the width (visible pixels) on each
image row. Useful in case that we want to align the initial pixel
address of each row (if DOC_USE_ALIGNED_PIXELS is defined).
This allows us to use some SIMD intrinsics (e.g. SSE2) for some image
functions in the future (right now implemented only in the new
is_same_image_simd_templ() for is_same_image()).
Anyway to avoid breaking some existing code, by default we'll still
keep the old behavior: row stride bytes = width bytes (so
DOC_USE_ALIGNED_PIXELS is undefined).
A reference to a doc object (Sprite, Layer, Cel, etc.) is done through
its ID in the scripting engine, when we try to access it from a script
that element might be already deleted. Previously we displayed the a
message like "Using a nil 'Cel' object". With this change we show the
traceback and a "Tried to access a deleted 'Cel'" message.
The old impl was using get/put_pixel(), the new slow one is using the
get/put_pixel_fast(), and the new default flip_image() is using just
raw pointers.
Added some utilites like random_image() for testing purposes, and
DOC_DISPATCH_BY_COLOR_MODE() macros to avoid switch/case for each
color mode. In a future these might use generic lambdas.
As Shift+Alt enables the subtract mode, if we touch an editor edges
and receive a MouseEnter message, we cannot update the selection
modifiers with the pressed Alt key because that will start rotating the
rectangular marquee automatically. We've to start rotating only if we
release the Alt key and then press it again (not by just moving the
mouse).
Recent regression introduced in bd91a6430f
when the ordering of MouseEnter/Move/Leave message order was fixed.
It looks like the mouse got captured by the Aseprite window if we
start the Zenity command using the mouse in certain way (e.g. when we
click the Open File link from the Home tab). The same doesn't happen
if we press Ctrl+O or click the File > Open menu.