Commit Graph

7950 Commits

Author SHA1 Message Date
David Capello
88e89b6c38 Don't catch unhandled exceptions so Sentry can report them
If we catch all exceptions and { do nothing }, we are probably missing
some crashes from being reported.
2024-01-03 12:04:55 -03:00
David Capello
318a2c60ea Fix crash in BackupObserver::saveDocData() using destroyed docs when app is being closed due to an exception (fix #3818) 2024-01-03 12:04:14 -03:00
David Capello
d8ed4d3995 Fix crash if an exception happens in DelayedMouseMove::commitMouseMove()
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.
2023-12-29 17:22:10 -03:00
David Capello
f178941f2c Fix crash copying, pasting, and transforming selection (fix #4249)
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.
2023-12-29 17:22:10 -03:00
Gaspar Capello
ba9ede873c Fix Alt+T -> Alt+V instantly crashes Aseprite without warning (fix #4221) 2023-12-27 16:58:37 -03:00
Martín Capello
3f00b3e593 Avoid div by zero by preventing returning a grid bounds with zero width or height (fix #4146) 2023-12-27 15:19:22 -03:00
David Capello
d3562b140c A Tx now will always try to lock the document if possible (#2430)
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.
2023-12-27 11:05:15 -03:00
David Capello
8722c8ec16 Lock document in Tx() ctor (part of #2430)
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.
2023-12-27 11:05:15 -03:00
David Capello
e87fdbb3af [i18n] Add some hardcoded strings to en.ini (fix #4237) 2023-12-22 15:03:07 -03:00
David Capello
e2d8db92d2 [i18n] Add support to escape more chars, like \s (fix #4236) 2023-12-22 11:37:04 -03:00
David Capello
96ef977311 Add new "shade_empty" style to paint the empty shades label (fix #4225) 2023-12-14 14:26:34 -03:00
David Capello
84187ad1ec Simplify strings for PaletteEditor command removing leading blanks
This issue was brought up here:
https://github.com/aseprite/aseprite/pull/4207#issuecomment-1845334373
2023-12-07 12:11:00 -03:00
David Capello
a118eea3cd Check strings only from en.ini file 2023-12-06 14:57:17 -03:00
David Capello
896e7f392e Change en.ini multiline format
Instead of using the simpleini format (which is not quite common/standard):

  key = <<<END
  line1
  line2
  END

We just use:

  key = line1\nline2
2023-12-06 14:15:21 -03:00
David Capello
609aedee12 Fix Weblate parsing error with strings outside any section
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
2023-12-06 13:45:10 -03:00
David Capello
abba4684a7 Fix error messages about locked sprite when deleting multiple cels (fix #4204)
This is a combination when we modify a layer property and then
modify/delete several cels/frames/layers.
2023-12-06 12:47:52 -03:00
Martín Capello
01c69a4cf7 Fix recovering of old crashed sessions having sprites containing slices
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.
2023-12-04 10:47:35 -03:00
David Capello
046b68061a Highlight dynamics button when some sensor is being used 2023-11-30 21:24:48 -03:00
David Capello
eeb5be9bed [lua] Fix crashes setting values out of bounds in JSON objects (fix #4166) 2023-11-30 18:40:02 -03:00
David Capello
82375462ae [lua] Fix reported crash setting nil as user data (fix #4187) 2023-11-30 16:10:59 -03:00
David Capello
10738b32c3 Use dynamics for brush preview only for freehand tools (fix #4178)
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).
2023-11-30 12:56:46 -03:00
David Capello
5ae2e444f2 Replace asserts limiting values directly in Entry::selectedRange()
There are some cases where these asserts failed (mainly in the
dithering matrix selection combobox).
2023-11-30 11:23:15 -03:00
David Capello
60b4524e41 Fix dithering matrix selection in Gradient tool (fix #4184)
Regression introduced in 8d435e02d8
2023-11-30 11:04:32 -03:00
David Capello
29b76353ef Fix "Select > Color Range" selection buttons visibility (fix #4177)
Reported in the forum: https://community.aseprite.org/t/20752
2023-11-28 15:28:31 -03:00
David Capello
f46ac5e807 Fix selection movement offset without fine control (fix #4175)
Cherry-picked this fix from the reverted commit 456113d015
2023-11-28 14:52:13 -03:00
David Capello
8d435e02d8 Fix performance regression drawing/showing brush preview (fix #4174)
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.
2023-11-28 12:47:24 -03:00
David Capello
a8885105e9 Move rows array back to the beginning of ImageImpl buffer
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
2023-11-28 11:34:50 -03:00
David Capello
6f3e9e21ad Fix crash reading corrupted files with invalid compressed data (fix #4171) 2023-11-26 22:27:14 -03:00
David Capello
7e331d95e2 Simplify main window title bar removing common suffixes
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.
2023-11-26 22:13:08 -03:00
David Capello
700217c413 Remove cmake policies that aren't used anymore 2023-11-26 21:46:20 -03:00
David Capello
28a140f736 Add missing #includes to use ASSERT() macro 2023-11-26 21:44:16 -03:00
David Capello
3486dcca7e Add minor comment in DocExporter::createEmptyTexture() (#4127, #4135) 2023-11-23 09:47:12 -03:00
Gaspar Capello
9f0cac32b3 Fix palette is not generated from RGB sprite sheet file after Export Sprite Sheet (fix #4127) 2023-11-23 09:42:19 -03:00
Gaspar Capello
8226e5285a Fix Dialog.bounds doesn't work as expected (fix #3898)
Prior to this fix, the 'Dialog:show()' function overrode bounds when
they were defined before the 'show' command.
2023-11-22 18:22:20 -03:00
David Capello
aeb7157277 Fix possibility to edit tileset base index (fix #4163)
Regression from 242555ab06
2023-11-22 16:11:49 -03:00
David Capello
0cc8769e29 Add tileset options when we convert a layer to a tilemap (fix #4158) 2023-11-22 14:37:27 -03:00
David Capello
eafb779ef0 Possible fix to some RotSprite crashes (#2780) 2023-11-21 12:58:31 -03:00
TakWolf
77ea4d40b8 Fix strings spelling typo: Difussion -> Diffusion. Notice, this is not compatible for translations. 2023-11-20 20:10:59 -03:00
David Capello
cbe14089af Enable FineControl for selection transformation only if we press the Ctrl key again (fix #3977)
Reimplement #3977 and #3990
2023-11-20 20:02:24 -03:00
David Capello
a27ea04f7d Revert "Fix after dropping a selection via Copy (Selection + Ctrl), handlers are not positioned correctly (fix #3977)"
This reverts commit 456113d015.
2023-11-20 16:38:12 -03:00
David Capello
fee543f9e1 Add option to disable Snap to Grid by default when we move the selection (fix #4153) 2023-11-20 15:19:38 -03:00
David Capello
8af4747635 Use configured dynamics of active tool w/o opening dynamics popup (fix #4151) 2023-11-20 14:50:52 -03:00
David Capello
cc0f8d0dc4 [lua] Fix crash calling io.open() without argument (fix #4159) 2023-11-20 14:34:50 -03:00
David Capello
340ed3f68f Fix crash making a tileset bigger and pressing Remap (fix #4144)
This happens only if the tilemap already has tile references outside
the valid range of the tileset (and even bigger than the new tileset
size).
2023-11-15 20:58:00 -03:00
David Capello
1311944667 Add option to enable the Snap to Grid option for the brush preview (fix #4137) 2023-11-15 20:30:58 -03:00
David Capello
f92f14f261 Fix possible crash adding reference layer (fix #3949) 2023-11-13 10:51:19 -03:00
David Capello
d39a656bb4 Merge branch 'flip' (fix #3603)
Implemented a specific item of tilemap feature (#977) to allow flipped
tiles in X/Y/Diagonal axes.
2023-11-13 09:31:20 -03:00
David Capello
62bdd8af9f Add "Advanced Options" checkbox in Tileset selector
To hide "Base Index" & "Allowed Flips" options by default.
2023-11-10 17:19:41 -03:00
David Capello
a56c801041 Move the timeline button in the toolbar to the bottom 2023-11-10 15:42:52 -03:00
David Capello
dd5fb871b5 Remap tiles with flags correctly 2023-11-10 11:55:23 -03:00
David Capello
25015a6e18 Fix eyedropper in Tiles mode to pick tiles that are flipped and have masked areas
Sprite::pickCels() wasn't taking care of the tile flags to pick
tilemap layers correctly with flipped tiles.
2023-11-09 16:44:46 -03:00
David Capello
302d998218 Add support to match flipped tiles automatically in Auto/Stack modes
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.
2023-11-09 16:44:46 -03:00
David Capello
25f61ff5f9 Fix bug w/auto tileset mode adjusting tiles when we replace a unique instance of a tile+flag with a new tile
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.
2023-11-09 16:44:46 -03:00
David Capello
34bd6cf336 Show tile flags in the editor canvas when we use Ctrl key/move tool
Added build_tile_flags_string() utility to create the string used in
to show the tile flags (XYD) on the status bar, the editor canvas,
etc.
2023-11-09 16:44:46 -03:00
David Capello
75b10d40be Remove unused variable in lambda function 2023-11-09 16:44:46 -03:00
David Capello
39bdba4a7d Fix assert converting Color{index} to a tile from tilemap.lua test
We must be able to convert a app::Color::IndexType to a tile index.
2023-11-09 16:44:46 -03:00
David Capello
78cda70ab6 Add support to flip/rotate tiles to ChangeBrush command (like #1222) 2023-11-09 16:44:46 -03:00
David Capello
5760b96708 Fix painting with tiles and flags 2023-11-09 16:44:46 -03:00
David Capello
20826e8730 Fix tile information (index/flags) in StandbyState 2023-11-09 16:44:46 -03:00
David Capello
b7de90a82b Fix eyedropper for tiles w/flags when picking colors from "Current Layer" 2023-11-09 16:44:46 -03:00
David Capello
0796d3732c Fix painting on flipped tiles in manual mode 2023-11-09 16:44:46 -03:00
David Capello
3606a54826 Fix eyedropper to pick colors/tiles correctly from flipped tiles
* 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.
2023-11-09 16:44:46 -03:00
David Capello
d3a8a10517 [lua] Add test about saving/loading/modifying tilemap w/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.
2023-11-09 16:44:46 -03:00
David Capello
b43fbe2249 Add simple rendering of tiles w/flags (x/y/d flip) 2023-11-09 16:44:46 -03:00
David Capello
d114b62483 New tile flags meaning (x/y/diagonal flip) + serialize then correctly
* 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)
2023-11-09 16:44:46 -03:00
Gaspar Capello
309a64de9f Fix export sprite sheet to RGB is not exporting the palette (fix #3881) 2023-11-09 12:16:53 -03:00
David Capello
81b5378f25 Minor refactor to set DitheringSelector combobox size hint (#4001, #4075)
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).
2023-11-08 16:55:12 -03:00
ChikenUni
1c3224a716 Fixed unnecessary scrollbar in X dimension for dithering selector dropdown.
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
2023-11-08 16:29:08 -03:00
David Capello
9885b89987 Possible fix for crash reports re-opening IntEntry popup when it's already open (fix #4124) 2023-11-07 17:21:35 -03:00
David Capello
853e10e483 Log UUID when -debug option is specified (fix #4104)
In this way, in some cases, we could ask to the user for the -debug
report and match some Sentry crash report with the user.
2023-11-06 19:59:20 -03:00
David Capello
8da8473c63 Minor comment in AppOptions::VerboseLevel 2023-11-06 19:43:24 -03:00
Dariy Guzairov
9772534ca5 Fix error message when attempting to delete layer in a group (fix #4083)
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).
2023-11-06 16:23:59 -03:00
David Capello
67d5314f0c Fix crash deleting layers while using "Change Layer" w/scroll wheel (fix #4114)
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.
2023-11-03 11:29:37 -03:00
Martín Capello
3cfa5ef1da [lua] Fix crash when saving tilemap's cel image (fix #4069) 2023-11-02 14:12:55 -03:00
Martín Capello
4a22518c3d Show custom pattern brushes for Paint Bucket (fix #4053) 2023-11-02 12:30:52 -03:00
David Capello
508c6c755d Update clip submodule 2023-10-30 15:43:25 -03:00
David Capello
557b22a719 [lua] Sprite:newTileset() uses sprite grid size by default (fix #4116) 2023-10-30 13:45:11 -03:00
David Capello
bb60da8c60 [lua] Make Sprite:newTileset(Rectangle) work (fix #4117) 2023-10-30 13:40:12 -03:00
David Capello
43079b226d [lua] Limit the possibility to create a tileset with origin != 0,0 (fix #4118) 2023-10-30 12:35:08 -03:00
Martín Capello
26523156da Improve script engine's exception handling
More details about the implications of this change can be found
in https://github.com/aseprite/aseprite/pull/4057
2023-10-26 11:24:51 -03:00
David Capello
56d293bff5 Update submodules (fix #4102) 2023-10-25 16:40:20 -03:00
David Capello
9800d0ba1a Support scaling down bits (e.g. from 10 to 8) with scale_xbits_to_8bits() doing a bit shift 2023-10-25 16:38:23 -03:00
David Capello
4387432ad3 Take some tests out from a loop they don't depend on 2023-10-25 11:59:28 -03:00
David Capello
dbb89b02a9 Rename scale_xxbits_to_8bits() -> scale_xbits_to_8bits() 2023-10-25 11:57:38 -03:00
David Capello
ae3b2dd144 Revert timeline behavior to the v1.2 default (#4024)
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
2023-10-25 08:36:54 -03:00
David Capello
83b1acac7c [x11] Update clip module to fix a problem pasting text to some text editors 2023-10-24 17:21:35 -03:00
Dariy Guzairov
ea35725c85 Fix disable delete layer button when only one layer exists (fix #3649) 2023-10-23 19:16:35 -03:00
Martín Capello
fc29686bb2 Prevent crash when in Auto or Stack mode the user tries to move pixels from a tilemap with inexistent tiles (fix #4071) 2023-10-12 14:22:18 -03:00
Nicolás Pinochet
4fc36aaf02 respect slice keys frame number on ase file format (fix #4062) 2023-10-11 18:18:30 -03:00
David Capello
f6db44b81d Fix std::clamp() assert in Manager::onInitTheme() 2023-10-11 15:05:10 -03:00
David Capello
eea59a58dd Minor fix in new timeline button in the toolbar (#4081, #4092)
The button was being painted with "toolbutton_last" part instead of
"toolbutton_normal" when it wasn't highlighted/in "hot" state.
2023-10-11 15:03:39 -03:00
David Capello
cf19b51226 Add new icon for the button to switch the timeline visibility (#4081, #4092) 2023-10-11 14:58:15 -03:00
Akylzhan
4f73b14f8f Add Timeline visibility button to Toolbar, extracted button draw logic to separate member function 2023-10-08 05:58:49 +06:00
Rowan Douglas
27ec013f8b
fixed time duration not including ending frame 2023-10-05 14:00:06 +01:00
David Capello
3f101d48d4 Add more accessible option to re-enable the Aseprite file dialog (fix #4051)
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.
2023-10-04 16:57:11 -03:00
David Capello
63fb39e0e8 Fix sprintf() warnings using snprintf() or fmt::format() 2023-09-27 19:57:41 -03:00
David Capello
5e34ae0ce2 Fix unused variable warnings 2023-09-27 19:57:41 -03:00
Martín Capello
8b747b4d09 Show brush preview for custom brushes when using Paint Bucket tool (fix #4052) 2023-09-26 14:57:11 -03:00
Gaspar Capello
6c3ff21354 Fix Full Preview and Edges setting on Cursors preferences (fix #3188) 2023-09-25 18:38:03 -03:00
Martín Capello
74d4154657 Set GraphicsContext.palette automatically when a Sprite's indexed image
or tileset's tile indexed image is drawn
2023-09-25 18:30:36 -03:00
Martín Capello
d777a9a325 [lua] Add GraphicsContext.palette property to set the palette used to draw indexed images 2023-09-25 18:30:36 -03:00
Martín Capello
54116a9550 Use transparent color when the source indexed image uses mask color (fix #3960) 2023-09-25 18:30:36 -03:00
Martín Capello
94b5158a5d Fix blend mode usage for GraphicsContext:drawImage(image, x, y) (fix #3960) 2023-09-25 18:30:36 -03:00
Gaspar Capello
bcbe61c882 Fix border padding on the right and bottom sides not being placed (fix #3993)
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.
2023-09-22 16:33:19 -03:00
Gaspar Capello
a0331743de Fix Color Range uses last active selection instead of active selection (fix #4045) 2023-09-20 11:44:23 -03:00
Gaspar Capello
db0bc5c6bb Fix F6 shortcut to show the timeline thumbnail by default (fix #4020)
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.
2023-09-20 11:43:43 -03:00
Gaspar Capello
aca8621bff Fix pattern Fill does not "Align to Destination" (fix #2528) 2023-09-20 09:56:01 -03:00
Martín Capello
ba99f41d82 [lua] Add "focus", "enabled", and "visible" common properties to tabs 2023-09-19 14:53:47 -03:00
Gaspar Capello
60233ba144 Changed the "Same in all tools" behavior (fix #4007)
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.
2023-09-19 14:27:24 -03:00
Gaspar Capello
5968440f90 Add memorization of tool-shared dynamics options (fix #4007) 2023-09-19 14:27:24 -03:00
David Capello
d8814fa2f9 Add option to avoid drag & drop timeline range from edges
Related to #1498 in some way to start enabling new selection modes in
the timeline.
2023-09-19 12:07:14 -03:00
David Capello
e2d8ffab54 Add reset buttons + tooltips to timeline range options (#4024) 2023-09-18 17:33:38 -03:00
David Capello
dd7e27a098 New (default) options to customize timeline range selection (fix #4024)
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).
2023-09-15 19:53:31 -03:00
Gaspar Capello
3f8a8662fe Fix respect snap to grid when we move the selection (fix #4021) 2023-09-14 13:03:15 -03:00
Martín Capello
709545c57e Avoid showing an alert (fired by the default clipboard error handler) when asking if the clipboard has a native bitmap (fix #4016) 2023-09-14 12:57:19 -03:00
Gaspar Capello
7b302794f9 Fix incorrect brush preview when Snap to Grid is active (fix #3743) 2023-09-14 12:33:21 -03:00
Gaspar Capello
6c34be5eb6 Fix initial folder for File > Save with the last one visited (fix #3996)
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.
2023-09-14 12:31:28 -03:00
Martín Capello
815366d385 [lua] Add support to modify tabs buttons via Dialog:modify 2023-09-12 17:21:00 -03:00
Martín Capello
6010748f81 [lua] Add tabs onclick and ontabchange events support 2023-09-12 17:21:00 -03:00
Martín Capello
d21f47f827 [lua] Add selected tab retrieval/selection through Dialog's data and possibility to set the tabs selector at the bottom 2023-09-12 17:21:00 -03:00
David Capello
0ae408fe4e [osx] Disable native file selector by default on macOS 10.11 (fix #3984) 2023-09-12 16:14:56 -03:00
David Capello
84bd6b69f5 [win] Fix bug pasting 8bpp images (fix #4029)
Fixes a bug copying 8bpp images (e.g. from YY-CHR program).
Regression introduced in 282b040b52

Related thread: https://community.aseprite.org/t/6842
2023-09-01 17:37:11 -03:00
David Capello
f4aa19ad8c Add names to threads (#3729)
This is useful for Sentry crash reports, so we can identify threads by
name.
2023-08-29 13:55:40 -03:00
David Capello
702a7d5265 [lua] Rename Dialog:canvas{ autoScaling -> autoscaling } (fix #4011) 2023-08-21 21:10:51 -03:00
David Capello
75d7834609 [lua] Add decorate={rulers, dimmed} params to app.editor:askPoint{} 2023-08-21 20:49:58 -03:00
David Capello
922ebf3039 [lua] Increment scripting API version 2023-08-21 20:49:58 -03:00
Gaspar Capello
572cdf2b0e Add check box "Same in all tools" in the Dynamics options window (fix #4003)
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)
2023-08-18 15:35:15 -03:00
Martín Capello
115e20d2a5 Add tab widget to lua api 2023-08-14 18:08:33 -03:00
Gaspar Capello
456113d015 Fix after dropping a selection via Copy (Selection + Ctrl), handlers are not positioned correctly (fix #3977)
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.
2023-08-14 18:08:20 -03:00
Gaspar Capello
2cc15cda9e Add save dynamics options between sessions (fix #3933) 2023-08-14 18:07:46 -03:00
David Capello
9755efece4 Add note to remove duplicated code incorporated in aebb370906 2023-08-14 18:06:55 -03:00
Martín Capello
aebb370906 Add autoscrollbars feature to Lua API Dialog:show function 2023-08-14 18:04:24 -03:00
Martín Capello
1143e3bb4f Limit window position to prevent hiding its title bar when using single-window UI (fix #3839) 2023-08-14 18:04:24 -03:00
David Capello
7358626859 Add flip/rotate brush support to ChangeBrush command (#1222)
Implement part of:
https://github.com/aseprite/aseprite/issues/1222
https://steamcommunity.com/app/431730/discussions/1/1479856439033920884/
https://community.aseprite.org/t/flipping-rotating-the-current-brush/1854
2023-08-09 21:56:55 -03:00
David Capello
2406e2b197 Add FlipDiagonal algorithm 2023-08-09 16:12:02 -03:00
David Capello
aeeef8e255 Add suppor for doc::Image row stride size > width size
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).
2023-08-07 15:27:39 -03:00
David Capello
ce37fbc8e3 Minor fix in doc_range_tests in the internal image used 2023-08-04 14:45:31 -03:00
David Capello
558ff54cb0 [lua] Add traceback info when a doc object is deleted and we try to use it
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.
2023-08-03 20:45:44 -03:00
David Capello
413288a014 Improve flip_image() performance (x10 from old impl, x2 from new slow impl)
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.
2023-08-02 17:35:20 -03:00
David Capello
2e1d50bf33 Fix some std::clamp() calls: max value cannot be less than min value 2023-07-31 10:31:08 -03:00
Gaspar Capello
ab2d7f79a3 Fix Magic Wand should "refer to visible layers" anyway when the active layer is hidden (fix #3939) 2023-07-25 10:27:06 -03:00
Gaspar Capello
a2e3ab44bd Don't rotate rectangular selection when we're in "subtract mode" and touch editor edges (fix #3976)
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.
2023-07-25 10:18:46 -03:00
David Capello
056073b3f1 Fix regression w/initial folder on file selector (fix #3979)
Regression introduced in 556c621eeb
2023-07-24 16:19:59 -03:00
David Capello
400456cbec Right-clicking a tileset mode button gives the possibility to set it as the default one
Feature request: https://community.aseprite.org/t/19487
2023-07-19 11:27:00 -03:00
David Capello
11644a7d16 Add Shift+F7 to toggle other layers visibility on Preview window 2023-07-19 10:56:16 -03:00
David Capello
32009723c5 [lua] Ask for access for package.loadlib() function 2023-07-19 09:15:15 -03:00
David Capello
890ed91d81 [x11] Disable the native file selector on X11 (#3974)
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.
2023-07-18 21:42:49 -03:00
Gaspar Capello
e9f078e66e Fix error decoding pico-8 GIFs (fix #3922) 2023-07-18 20:55:32 -03:00
Martín Capello
242555ab06 Allow changing the tileset assigned to a tilemap layer 2023-07-18 18:50:57 -03:00
Martín Capello
4926f4c1fc Show, duplicate and delete tilesets in Sprite Properties dialog (fix #3875) 2023-07-18 18:50:57 -03:00