Commit Graph

7329 Commits

Author SHA1 Message Date
Martín Capello
fcac48cccb Add option to enter Aseprite license key (#2664)
This is an initial version to add an automatic update feature in the
future.
2022-06-28 19:09:10 -03:00
David Capello
faecd682fc Merge branch 'main' into beta 2022-06-28 19:05:54 -03:00
Martín Capello
306e13dfad Clear the exported images with its mask color instead of 0 (fix #3391) 2022-06-28 18:43:23 -03:00
Gaspar Capello
1f5e4cfc4f Add '{title}' and '{layer}' functionality to the Export dialog (fix aseprite/aseprite#3363)
Also Add '{title}' functionality to CLI dialog on sprite-sheet file name
2022-06-28 18:42:33 -03:00
David Capello
3d0b5d809c Fix bug in move_or_copy_palette_colors() accessing out-of-range index 2022-06-28 15:17:29 -03:00
David Capello
6d30f274f4 [msvc] Fix problem using invalid min/max bounds in std::clamp
There is an assert() in the std::clamp() impl on MSVC that checks if
the min/max values are valid.
2022-06-28 14:02:18 -03:00
David Capello
caf475b2dc Merge branch 'main' into beta 2022-06-15 13:44:34 -03:00
David Capello
b7d5d4a2c9 Editable resize factor in File > Export (fix #3007)
Related to #3008
2022-06-15 12:25:43 -03:00
David Capello
af74f8bc84 Fix memory leak when the created cel is not used in ExpandCelCanvas 2022-06-14 23:25:10 -03:00
David Capello
4aa5fedfec New "on the fly" resize when saving/exporting image (fix #1112)
Implemented using a new FileAbstractImage interface to get scanlines
for each frame automatically resized (without modifying the original
sprite/without using SpriteSize command/adding new undo information).

Related to #3008
2022-06-14 23:19:39 -03:00
David Capello
c58dae51fa Fix crash using a deleted surface in Overlay::restoreOverlappedArea()
Can happen when a resize event is received and m_captured stores the
surface with the old window size.

This was found opening a file from the CLI on Linux/X11.
2022-06-14 21:39:38 -03:00
David Capello
e2798bc849 Fix crash creating the "No Recent File" w/AppMenuItem() (fix #3371) 2022-06-14 14:01:28 -03:00
David Capello
30b61e501e [lua] New Image(Image, Rectangle) ctor 2022-06-14 10:04:54 -03:00
David Capello
82cd244a6e Add support to use SaveFile commands from CLI (without UI) 2022-06-13 19:19:44 -03:00
David Capello
ddc1b76214 Convert SaveFileBaseCommand to CommandWithNewParams
With this patch we fixed some use cases:
* We can show the ui with a default filename { filename=..., ui=true }
* We can specify fromFrame/toFrame for SaveFileCopyAs
2022-06-13 17:04:12 -03:00
David Capello
d160fb8b91 Minor changes in SaveFileCommand to use enums instead of bool params 2022-06-13 12:46:11 -03:00
David Capello
8f44b521b6 Merge branch 'main' into beta 2022-06-10 10:31:13 -03:00
David Capello
4471dab289 [osx] We cannot use std::optional::value() if we want to support macOS 10.9
It looks like value() member was introduced in macOS 10.13 (error
detected because we use CMAKE_OSX_DEPLOYMENT_TARGET=10.9).
2022-06-09 19:07:08 -03:00
David Capello
71d885d2a0 Replace base::clamp -> std::clamp as now we use C++17 2022-06-09 19:05:48 -03:00
David Capello
b2d46bf10b Use std::unique_ptr/optional in more App objects 2022-06-09 17:29:40 -03:00
David Capello
99c0d5b743 Fix SpriteEvents destruction (fix #3162)
Classic "static initialization order fiasco" but in the destruction
phase.
2022-06-09 16:28:25 -03:00
David Capello
1630416991 Fix a crash when a script generates a Fg/BgColor change when closing the app
If a script Dialog changes the app.fgColor/bgColor in its onclose
callback, it will notify all fgColor/bgColor preference
observers (ContextBar is one of them), if we don't disconnect from
these signals when we're deleting ContextBar, the signals will call a
deleted slot/connection from app::script::close_all_dialogs().
2022-06-08 16:24:36 -03:00
David Capello
fa6325d237 Add extra checks in Manager::_closeWindow() to avoid crashes
Possible fix for #3362
2022-06-08 13:10:26 -03:00
David Capello
39ba883f90 Fix bugs executing plugin init/exit() functions in different situations
Reinstalling a previously enabled plugin extension wasn't running the
init() function, and uninstalling it wasn't calling its exit()
function.
2022-06-07 15:02:54 -03:00
David Capello
a39e235b23 Don't store a Command* pointer in AppMenuItem (fix #3359, fix #3360)
Instead of storing a Command* we can store the command ID, which it's
less problematic in extreme cases where the Command that is being
referenced is deleted or recreated, i.e. when a plugin is
disabled/re-enabled.
2022-06-07 14:47:40 -03:00
David Capello
f9d0e441d3 Be able to select a range of colors/tiles to the end just moving the mouse outside the palette region 2022-06-02 10:32:15 -03:00
David Capello
eb4fbe9114 Fix bug selecting any tile from the color bar (fix #3357) 2022-06-02 10:31:15 -03:00
David Capello
77771b703b Merge branch 'main' into beta 2022-05-30 20:41:35 -03:00
David Capello
93dcc0349f Fix warning by ThreadSanitizer in HttpLoader 2022-05-30 19:41:41 -03:00
David Capello
6ce205e0db Add experimental option to disable shaders for color selectors (#960) 2022-05-30 19:35:01 -03:00
David Capello
1781ee0f15 Fix bug painting a spot w/brush size=max when releasing the mouse after auto-scrolling 2022-05-30 18:45:57 -03:00
David Capello
251323a4d5 Add new MouseMessage() ctor to copy full information of the original message
This is mainly to keep the pressure information when a MouseMessage is
copied, and any future property which could be added in MouseMessage.
2022-05-30 18:44:12 -03:00
David Capello
23b269a6bc Use shaders for ColorWheel selector
This patch includes a fix for the RYB color wheel (the blue was not in
the correct hue angle).
2022-05-27 19:57:37 -03:00
David Capello
b561a6fbfb Use Sentry breadcrumbs to get wintab32.dll information
Useful to detect which vendor is causing most of the crashes related
to wintab32.dll. Related to:
https://github.com/aseprite/aseprite/issues/2785#issuecomment-1033222868
2022-05-26 19:34:23 -03:00
David Capello
0e9001fbd3 Go to Desktop instead of showing an error if a parent folder is deleted in the middle of files navigation 2022-05-24 09:06:32 -03:00
Kukhyeon Heo
c457f1680a [win] Fix crash browsing files when a folder is deleted (fix #2950) 2022-05-23 18:21:11 -03:00
David Capello
684d06ede8 Merge branch 'main' into beta 2022-05-23 18:04:55 -03:00
David Capello
f886e85af9 Restore Reference Layer bounds correctly if we delete a cel & undo it (fix #3264) 2022-05-23 18:01:38 -03:00
David Capello
fd430603a0 [lua] Allow to compare different docobj types without failing (fix #3218)
Just return false if we compare a layer with a sprite, etc.
2022-05-23 17:15:15 -03:00
David Capello
3ac4ca8869 Create a custom widget for UndoHistory (fix #3281)
Several performance issues fixed (as we avoid keeping a ListBox with
ListItem in sync with the UndoHistory/UndoStates). There is still some
room for improvement: e.g. grouping several ui::View::updateView() in
just one if several onAddUndoState() will be called (e.g. when we are
running a script without transactions).
2022-05-23 16:19:06 -03:00
David Capello
1366a6948c Fix performance issues adding/deleting widgets (related to #3281) 2022-05-20 11:03:12 -03:00
David Capello
b9206cc872 Fix locked sprite errors moving/copying multiple cels when the Cel (or Layer) Properties dialog is open (fix #3278) 2022-05-19 19:15:32 -03:00
David Capello
52779d4b09 Fix memory leak in UserDataView simplifying its ctor
Each "new gen::UserData" wasn't being freed.
2022-05-19 18:56:21 -03:00
David Capello
9edbd717d8 Swap buffers in Display::flipDisplay() 2022-05-19 17:00:19 -03:00
David Capello
ff5afba6ae Merge branch 'main' into beta 2022-05-19 16:55:30 -03:00
David Capello
4f9fe90304 Display the Hue bar in ColorTintShadeTone with saturation/value=1.0
This is the previous behavior, but might change in the future.
2022-05-17 13:43:22 -03:00
David Capello
aca96c6d36 Use shaders for ColorTintShadeTone/ColorSpectrum selectors (#960)
This is the first step to optimize the painting code of ColorSelectors
which were using a background thread to paint their
surface. ColorWheel is still using the old method (without shaders).

This impl is already a lot faster on CPU, and it's ready for
GPU-acceleration in a future.
2022-05-17 13:24:53 -03:00
David Capello
4b99d3022a Minor change in ColorSelector to resize the previous rendered canvas 2022-05-17 09:07:52 -03:00
David Capello
922f99ef87 Use Graphics::drawSurface() with explicit Sampling/Paint options 2022-05-17 09:07:24 -03:00
David Capello
38fca8ed61 Don't use std::iterator<> as it's deprecated in C++17 2022-05-16 11:50:12 -03:00
David Capello
b5414c5d95 Merge branch 'fix-2776' of https://github.com/ruerob/aseprite into ruerob-fix-2776 2022-05-13 15:25:18 -03:00
David Capello
0a3644dfbb Update laf module with initial GPU support (#960)
Anyway this is incomplete and Aseprite is not yet ready to support GPU
acceleration (as the rendering phase is CPU intensive).
2022-05-13 11:41:44 -03:00
David Capello
8d2863a58b Merge branch 'main' into beta 2022-05-05 09:57:29 -03:00
David Capello
adaef68bbb Minor change in macros to detect platform 2022-05-05 09:39:16 -03:00
David Capello
7fea99a718 Move the "invert wheel for brush size" option to Edit > Keyboard Shortcuts > Mouse Wheel 2022-05-05 09:26:19 -03:00
David Capello
04903692f9 Add some comments & simplify code handling WheelAction::BrushSize 2022-05-05 09:15:00 -03:00
Thanos Kamber
2a00d41e95 Changed the default behaviour in Windows and Linux
This commit makes the default behaviour for changing the brush size to
be scroll up to increase brush size, this should already be the case
in macOS.

Note: It's correct in Windows and Linux, but I don't have a mac to test
it with.
2022-05-04 18:49:22 -03:00
Thanos Kamber
b9dfad6b6b Option invert scrolling direction for brush size (closes #2364)
This commit adds the option to invert if the brush size increases or
decreases when holding CTRL and scrolling as mentioned in the issue #2364

By default, the previous behavior is kept.
2022-05-04 18:48:45 -03:00
David Capello
9248f53447 Don't invalidate the cached file system on each action
We can use the refresh button for this, and in a future we could
refresh it when the window loses focus and is activated again, or
listening the file system changes.
2022-05-03 15:46:01 -03:00
David Capello
db84c02e94 Fix crash accessing an invalid iterator in FileSelector::onRefreshFolder() 2022-05-03 15:24:55 -03:00
David Capello
debd22014c Fix program hanging when calling FileSelector::refresh()
The FileSystemModule is already locked, so if we use LockFS another
time it will try to lock a FileSystemModule::m_mutex for a second
time.
2022-05-03 15:14:44 -03:00
David Capello
f41c6bc1c5 Fix compilation in macOS (and add Command+R to refresh) 2022-05-03 15:11:47 -03:00
David Capello
a004b7dfe1 Merge branch 'fix-232' of https://github.com/Enfyve/aseprite into Enfyve-fix-232 2022-05-03 15:11:27 -03:00
David Capello
dfa357eb8d Add an experimental CommandResult for the execution of commands
This makes possible to return true or false after the execution of
each command app.command.CommandName() if it successes or fails.
Currently the Lua API documentation says something about this here:

  https://github.com/aseprite/api/blob/main/api/command/ReplaceColor.md#replacecolor

But this is not true, the function always returned nil. Now it will
return true or false.
2022-04-29 09:53:57 -03:00
David Capello
cc7da16691 Run Console in background so commands can continue running and logging to the console if needed (fix #3227) 2022-04-28 21:58:15 -03:00
David Capello
94065571b5 [x11] Add possibility to set a user-defined string to detect styluses (#3176) 2022-04-28 16:33:21 -03:00
David Capello
f638b5ca2b Fix minor memory leak loading a doc::Palette from backup data 2022-04-26 12:16:31 -03:00
David Capello
c15f374690 Fix timeline re-painting issue when changing tag color (#3242)
This is the worst possible hack, but we're already doing this for cel
and layer color. Something to think about with #3266
2022-04-25 15:14:02 -03:00
David Capello
b31affd2e8 Fix timeline re-painting issue when changing tag range (#3242) 2022-04-25 14:00:26 -03:00
David Capello
96cb38c29d Fix timeline re-painting issue when renaming a tag (#3242) 2022-04-25 13:32:16 -03:00
David Capello
1601f7f4b1 Fix timeline re-painting issues when copying & pasting cels (fix #3242) 2022-04-25 12:54:13 -03:00
David Capello
2a59076f49 Merge branch 'main' into beta 2022-04-25 11:45:31 -03:00
David Capello
e45e05eaff Don't create new threads for files we couldn't generate a thumbnail for 2022-04-22 13:12:48 -03:00
David Capello
319824021b Keep plugin preferences when re-installing an extension (fix #3259) 2022-04-22 09:09:10 -03:00
David Capello
65ef6f8e96 Replace utf8 iterators with utf8_decode (fix #3260)
This should fix some problems decoding invalid UTF-8 strings.
2022-04-21 20:24:49 -03:00
David Capello
75a99360a0 Use std::mutex & std::thread in ThumbnailGenerator 2022-04-21 12:46:21 -03:00
David Capello
f5bce17e7b Delete unused code in FileOp and FileFormat 2022-04-21 12:23:52 -03:00
David Capello
737a60c5ac Minor change in ThumbnailGenerator::instance() 2022-04-19 17:46:31 -03:00
David Capello
78ec753a3c Simplify list of workers in ThumbnailGenerator with unique_ptrs 2022-04-19 17:14:50 -03:00
David Capello
f0a7d1faaa Fix data race loading next thumbnail without locking the item
This was detected with -fsanitize=thread
2022-04-19 17:09:49 -03:00
David Capello
03e0bc26c9 Fix bug initializing auxiliary table for findBestfit() from multiple threads
This could happen if we generated thumbnails for GIF files from
multiple threads when showing the File > Open dialog for the first
time (calling findBestfit() from multiple threads).
2022-04-19 17:07:37 -03:00
David Capello
82a0ec5199 Improve seleting words w/double-clicking on a ui::Entry (fix #3229)
* Now we support selecting multiple words at the same time
* Now punctuation is not included as part of the word
2022-04-19 16:17:28 -03:00
David Capello
83e2604d12 Make ui::Entry smaller 2022-04-19 08:48:50 -03:00
David Capello
52667855d5 Fix public -> private in ui::Timer 2022-04-18 18:01:39 -03:00
David Capello
46626bb5ce Merge branch 'main' into beta 2022-04-13 23:01:12 -03:00
David Capello
e4c2995326 Extensions now support defining keyboard shortcuts (#1403, #3239) 2022-04-13 22:46:48 -03:00
David Capello
721e401052 Fix some memory leaks & simplify code sending UI messages 2022-04-13 21:04:54 -03:00
David Capello
b4d3692927 Add ShowMenu command so the user can customize Alt+top level menu mnemonic shortcuts (#3239) 2022-04-12 22:52:09 -03:00
David Capello
3645afd9a2 Add ui::Widget::resetMin/MaxSize() member functions 2022-04-12 21:14:07 -03:00
David Capello
c450bf7c50 const-correctness for ui::Widget member functions to find children 2022-04-12 21:07:20 -03:00
David Capello
93b0e9e520 Fix painting extra straight line using Ctrl+Shift w/Pencil tool (fix #3196) 2022-04-12 19:11:20 -03:00
David Capello
43513e0f1b Don't show tooltip when a new frame/layer is created from a script transaction
This might improve the performance of some scripts if it creates
several frames/layers at the same time.
2022-04-11 09:53:01 -03:00
David Capello
11417c56ac [lua] Add Cel.frame setter to move a cel quickly 2022-04-07 19:48:39 -03:00
David Capello
b4e9d7b155 Fix memory leaks when deleting backups from recovery data 2022-04-07 11:48:49 -03:00
David Capello
f489b7085a Merge branch 'main' into beta 2022-04-06 09:33:51 -03:00
David Capello
9e7077b442 Update clip module (includes https://github.com/dacap/clip/issues/57) 2022-04-06 09:33:23 -03:00
David Capello
adce7ce23e Merge branch 'main' into beta 2022-04-06 00:12:20 -03:00
David Capello
e61888fc92 Fix compilation when ENABLE_UI is disabled and UIContext isn't defined 2022-04-06 00:10:49 -03:00
David Capello
ab2cef1c29 Merge branch 'main' into beta 2022-04-06 00:00:44 -03:00
David Capello
2594892dd5 Fix crash when a Lua error happens in a Dialog onclose (fix #3237) 2022-04-05 23:57:36 -03:00
David Capello
16ca5a55db Merge branch 'main' into beta 2022-04-05 23:16:55 -03:00
David Capello
3ed969ff0a Close all docs correctly even in case of exception (fix #3162) 2022-04-05 23:07:08 -03:00
David Capello
2a908f79df lua: Dialog() must return nil if there is no UI available
This avoids some crashes when running in --batch mode and some script
tries to create a Dialog().
2022-04-05 20:45:34 -03:00
David Capello
66d74688e2 Merge branch 'main' into beta 2022-03-31 19:34:38 -03:00
Gaspar Capello
683747f412 Remove tag range adjust when exporting sprite sheets (fix #3210)
Before this fix, tag ranges were adjusted in the json data file, in the 'meta' sector, when the --list-tags and --ignore-empty flags were set.
Particularlly, when --split-layers, --list-tags, and --ignore-empty were on, the calculation of tag ranges could fail with cels with pure mask pixels.
2022-03-31 17:35:49 -03:00
Gaspar Capello
b70a29269d Fix wrong json export with linked, trimmed cels (fix #2600)
Before this fix, the json file associated with the exported sprite sheet had wrong 'spriteSourceSize' coordinates in particular cases like this:
- Linked cels
- Export Sprite Sheet options: TrimmedCels + Merge Duplicates + SplitLayers checked
2022-03-31 16:43:14 -03:00
Jeremy Behreandt
d429797359 Fix Lua Color HSL Constructor
Changed call from HSV to HSL for Lua Color HSL constructor.
2022-03-29 23:15:17 -03:00
David Capello
c08dc44901 Revert "Fix multi layer movement in tilemap mode (fix #3144)"
This reverts commit bc050e8f15.
2022-03-15 13:40:46 -03:00
David Capello
3215051bc7 Merge branch 'main' into beta 2022-03-14 17:25:28 -03:00
David Capello
da4908474e Fix crash when showing the palette popup (fix #3189) 2022-03-14 17:21:54 -03:00
Gaspar Capello
bc050e8f15 Fix multi layer movement in tilemap mode (fix #3144)
Before this fix, a multi-layer mask move (with mixed layer types:
normal layer and tilemap layers with different grids) caused loss of
drawing areas.

The heart of this solution is to correctly align the 'selection mask'
and 'transform data' according to the layer's grid, and also, forcing
'site' TilemapMode/TilesetMode before each
reproduceAllTransformationsWithInnerCmds() iteration.

The scale transformation could have some things to improve in later
commits. Not fully tested yet.
2022-03-14 11:13:11 -03:00
David Capello
70a42c4c77 Add WheelAction to change InkType (related to #3195)
Mockup contributed here: https://community.aseprite.org/t/2468/10
2022-03-10 16:08:56 -03:00
David Capello
ffc7af2ee8 Merge branch 'main' into beta 2022-03-10 15:50:05 -03:00
David Capello
54c354f5d2 Fix forward declaration of os::Sampling 2022-03-10 15:44:56 -03:00
David Capello
8064179dfc Don't show clipboard error when we're trying to show the File > New dialog
The error is confusing because the user doesn't know that we're trying
to access the clipboard info only to fill Width/Height fields
automatically on File > New. Some errors (like "invalid image format")
should be displayed only when we use Edit > Paste explicitly.
2022-03-10 15:28:52 -03:00
David Capello
e5b0d9de8d Update tga module 2022-03-08 20:57:19 -03:00
David Capello
4ce2d1a340 Add option to simulate mouse wheel using key shortcut+drag mouse (fix #3195)
Now we can change several values (zoom, brush size, etc.) pressing a
keyboard shortcuts and dragging the mouse in a specific vector
direction (DragVector). It allows the modification of one, two, or
even more parameters at the same time (e.g. X axis to change the brush
size, Y axis the alpha value of the ink).
2022-03-08 20:40:11 -03:00
David Capello
7e1d3832f0 Merge branch 'main' into beta 2022-03-04 23:56:55 -03:00
David Capello
c5ee08e3b5 Add required include directory to use doc/dio/fixmath libraries
This is used for the fuzz project.
2022-03-04 23:53:43 -03:00
David Capello
3dd47f913f Add missing strings for WheelActions to move through tiles 2022-03-03 18:07:51 -03:00
David Capello
18ba8f184b Merge branch 'main' into beta 2022-03-02 21:31:31 -03:00
David Capello
31ce326d5b Fix ink tests when ENABLE_UI=0
It looks like we cannot trust in the get_current_palette() content
when we are running scripts without UI. So it's preferable if we get
the palette directly from the sprite.

We should completely remove the get_current_palette() function.

Tests can be found in https://github.com/aseprite/tests/blob/main/scripts/inks.lua
2022-03-02 21:27:06 -03:00
David Capello
4b3b1f31e0 Fix ChangePixelFormatCommand so it can be compiled/linked when ENABLE_UI=0 2022-03-02 21:26:14 -03:00
David Capello
c40993e284 Merge branch 'main' into beta 2022-03-02 16:07:22 -03:00
Gaspar Capello
ef31179934 Fix painting with transparent color, opacity 255, Indexed color mode, in Alpha Compositing to behave as Simple Ink (fix #3047) 2022-03-02 15:28:25 -03:00
David Capello
e12fb556c1 Fix contour tool + pixel perfect when drawing just one pixel
Bug report: https://community.aseprite.org/t/13149
2022-02-25 15:05:29 -03:00
David Capello
2bb93247aa Fix modifying slice bounds before the 1st SliceKey frame (fix #3122)
This issue brought a lot of other related issues (like slice chunks
being saved incorrectly in .aseprite file, etc.). This is an
alternative fix to PR #3141 where a std::sort() was proposed.
2022-02-25 09:42:32 -03:00
David Capello
2100c45de2 Fix memory leaks when we use doc::Keyframes structure
Detected with LeakSanitizer on keyframes_tests but also reported in
PR #3141. We've finally solved this problem using std::unique_ptr.
2022-02-24 19:53:42 -03:00
David Capello
d16c34b247 Fix memory leaks in some tests found with LeakSanitizer 2022-02-24 19:43:22 -03:00
David Capello
cef7e7eed1 Don't show edge layers when we draw
If we have the View > Show > Layer Edges option enabled, the active
layer edges are always visible, and it is confusing when we're drawing
because we temporarily modify the cel position/bounds. It's better if
we hide the edges in the DrawingState.

Regression introduced in 31bf651d8b
2022-02-24 17:00:21 -03:00
Joshua Ogunyinka
31bf651d8b Fix panning canvas out of view clips in Auto Guides (fix #2994) 2022-02-24 16:51:43 -03:00
David Capello
04fa9a47ab Merge branch 'main' into beta 2022-02-24 16:42:05 -03:00
David Capello
b212a24479 Add sampling options to Edit > Preferences dialog too (#3183) 2022-02-21 16:21:07 -03:00
David Capello
5ccf414183 Add options to change the downsampling algorithm (fix #3183)
Also we've restored the default algorithm to bilinear + mipmapping,
which was the default on the Aseprite before we switched to Skia m96.
This was requested by some users.
2022-02-21 15:30:09 -03:00
David Capello
3162d224f7 Add editor_benchmark
This is a simple initial benchmark to test how well the editor perform
in common operations like scroll and zoom. We have plans to improve it
through caching (and GPU textures) progressively.
2022-02-21 10:31:54 -03:00
David Capello
7e76d81fcc Merge branch 'main' into beta 2022-02-18 19:32:33 -03:00
David Capello
2d3de1728c Add SkinTheme::get() to avoid using SkinTheme::instance() as much as possible
This was done to avoid some nullptr references using
SkinTheme::instance() (mainly from
StatusBar::IndicatorsGeneration::add()) when the application is being
closed because an exception was thrown. This might be useful to detect
certain kind of crashes from Sentry.
2022-02-18 19:01:46 -03:00
David Capello
104f8a10cf Fix crash using invalid index in FileItemList (fix #3181)
There is a state where m_selected is pointing to an item that doesn't
exist in the current list of items. We didn't detect this on Debug
mode yet, but we've received one Sentry crash report about it.
2022-02-17 10:36:18 -03:00
David Capello
8b5133b4c0 [lua] Fix context used in App.useTool() 2022-02-11 10:41:56 -03:00
David Capello
0c1e08138e [lua] Fix crash using app.useTool() when the active editor is in MovingPixelsState (fix #2933)
More information in https://github.com/aseprite/aseprite/pull/3166
2022-02-11 10:19:32 -03:00
David Capello
1f4e3bcd11 Merge branch 'main' into beta 2022-02-08 12:56:26 -03:00
David Capello
845ff17788 Fix "Reset Scale" notification when there is enough workarea available
Instead of using the window size, we can use the available workarea to
know that the user can resize the main window to its full size and
there will be enough room to display some common dialogs like the
Preferences one.
2022-02-08 12:07:36 -03:00
David Capello
903401e28d Fix radial gradient when the gradient vector is close to (0,0) (fix #3126) 2022-02-07 19:03:40 -03:00
David Capello
0588ebd01b [lua] Generate onclick event when we reorder/click a Dialog:shades with { mode="sort" } (fix #3081) 2022-02-04 17:36:49 -03:00
David Capello
97389dd1a3 [lua] New API version 2022-02-04 14:08:19 -03:00
David Capello
9cf2ff782f [lua] Fix Color.index to return an integer instead of a number (fix #3159) 2022-02-04 13:44:13 -03:00
David Capello
8d4941d86c [lua] Add Color{ index } ctor 2022-02-04 13:43:43 -03:00
David Capello
0cfeacab5c Stop filter preview before we change filter parameters
Similar fixes as in 811b893320
2022-02-03 14:59:46 -03:00
Joshua Ogunyinka
811b893320 Fix occassional crashes in despeckle/median filter (fix #2903) 2022-02-03 12:51:30 -03:00
Gaspar Capello
653931c4fc [lua] Add a warning message deleting objects that are not part of the sprite (fix #3135)
Before this fix, the Sprite:deleteLayer/Slice/etc() Lua functions
didn't warn the user if its argument (a layer/slice/etc) didn't belong
to the corresponding sprite.
2022-02-03 11:02:55 -03:00
David Capello
aec012a0d9 Fix crash using a nullptr m_pixelsMovement on MovingPixelsState::onCommitMouseMove() (fix #3161) 2022-02-03 10:57:49 -03:00
Joshua Ogunyinka
aa188d641b Fix moving rectangular marquee box while selecting color (fix #3143) 2022-02-03 10:11:25 -03:00
David Capello
bf48381c23 Show selected index correctly in PaletteViews used from ColorPopups (regression introduced in d164458c24) 2022-01-14 16:44:13 -03:00
David Capello
ce9640fbd3 Fix regression about hidden Frame/Zoom indicators by default in StatusBar
Bug report: https://community.aseprite.org/t/12488/11
2022-01-14 16:27:00 -03:00
David Capello
23db76216a Fix full MenuBox width when adding scrollbars and exceeding the workspace.x2() limit 2022-01-14 15:18:18 -03:00
David Capello
69d0564a09 Fix crash closing a MenuBox with viewport (fix #3132, fix #3133)
Regression introduced in ed595eb6b1
calling MenuBox::setMenu() of the first child of a MenuBoxWindow when
handling its kCloseMessage. The firstChild() was supposed to be a
MenuBox, but we didn't take care of the case when the MenuBox is
replaced with a View when scrollbars are needed (added by
add_scrollbars_if_needed()).
2022-01-14 15:09:50 -03:00
David Capello
0b3773b17d Merge branch 'main' into beta 2022-01-13 08:44:22 -03:00
David Capello
9e23d31d84 Fix crash using Shift key in Pencil tool
Bug introduced in f3fd0de3d0
2022-01-13 08:43:03 -03:00
David Capello
835b76e83a Merge branch 'main' into beta 2022-01-13 07:09:25 -03:00
David Capello
f3fd0de3d0 Improve detection of one click when using a stylus
We can interpret a quick mouse down/up events (e.g. less than 250
milliseconds) as a simple click if the mouse doesn't move too much in
the middle of both events (e.g. a tiny rectangle of 7x7 pixels).

Some discussion about this: https://community.aseprite.org/t/12491/10
2022-01-12 23:23:19 -03:00
David Capello
87e8b45dc1 Fix regression clicking same spot w/Rectangular Marquee to deselect
Regression introduced in 26c1a94b83

Reported:
- https://community.aseprite.org/t/12491/1
- https://steamcommunity.com/app/431730/discussions/0/3200371016617015005/
2022-01-12 22:23:26 -03:00
David Capello
14a9327573 Fix popup menu size when multiple windows UI is disabled
Fixed regression introduced in ed595eb6b1

Reported:
- https://community.aseprite.org/t/12497
2022-01-12 22:22:05 -03:00
David Capello
53c1041953 Merge branch 'main' into beta 2022-01-11 14:42:48 -03:00
David Capello
5b1740cddd [win] Fix the detection of a crash to report via Sentry 2022-01-11 14:39:52 -03:00
David Capello
07cf70361b Set os::Window user data to nullptr before setting mouse cursors
In this way we don't process any queued native message for the display
as it will be deleted. This could be a possible fix for some crashes
reported in set_native_cursor_on_all_displays() (#2907)
2022-01-11 11:43:05 -03:00
David Capello
0f04e016b6 Set same scroll position in timeline after updating scrollable area
This fixes the following problem:

* Hide the Timeline, and restart the program
* Open a sprite with a lot of layers
* Show the Timeline

Without this fix, depending on the selected layer the scroll will be
invalid and the layer will not be displayed by default when the
Timeline appears.

Related to 229ded9642
2022-01-11 11:34:30 -03:00
Joshua Ogunyinka
f9d41665f0 Fix bounds getting reset when a dialog is closed (fix #3018) 2022-01-11 11:20:01 -03:00
David Capello
d52455b200 Fix centering the Console correctly when using UI w/multiple windows 2022-01-11 10:41:58 -03:00
David Capello
efd8a71b9f Merge branch 'main' into beta 2022-01-10 17:03:04 -03:00
David Capello
817879d700 Fix possible infinite loop reading broken .aseprite files (fix #3123) 2022-01-10 17:00:12 -03:00
David Capello
f7a87af0fd Fix crash using Shift+click on Pencil tool (cherry-picked from ab3bf31c6a) 2022-01-10 15:59:36 -03:00
David Capello
229ded9642 Fix regression detected in #3066 setting default timeline scroll pos 2022-01-10 11:41:33 -03:00
David Capello
8ec2fff447 Merge branch 'main' into beta 2022-01-06 18:44:38 -03:00
David Capello
06cfbd794e Use DelayedMouseMove for MovingCelState too (#3119) 2022-01-06 18:43:12 -03:00
David Capello
ab3bf31c6a Merge branch 'main' into beta 2022-01-06 17:44:43 -03:00
David Capello
26c1a94b83 Group several mouse movement in one on the Editor
Mainly for Line-like tools (which require the last mouse position
only). Related to #3119, possible fix for several performance issues
on Linux mainly.
2022-01-06 16:54:39 -03:00
David Capello
bc8e1b36eb Update copyright year 2022-01-05 20:45:08 -03:00
David Capello
ed595eb6b1 Fix crash when a MenuBoxWindow is closed from the os::Window close button (#2777) 2022-01-05 20:33:32 -03:00
David Capello
6e726025ee Merge branch 'main' into beta 2022-01-05 20:16:13 -03:00
David Capello
4619089869 Fix warning in ColorBar::onIsPaletteViewActive() 2022-01-05 20:14:00 -03:00
David Capello
02de9be1ab Rename src/tests/test.h -> src/tests/app_test.h to avoid confusion with observable tests/test.h 2021-12-23 21:38:17 -03:00
David Capello
6836911661 Don't define HAVE_CONFIG_H and include "src" directory globally
Avoid using include_directories() and add_definitions() as much as
possible.

This change was made to avoid a problem using HAVE_CONFIG_H on Sentry
breakpad implementation where HAVE_CONFIG_H is used (but our config.h
is different from the expected one in breakpad).
2021-12-22 19:08:43 -03:00
David Capello
a7a344339c Update laf & clip submodules 2021-12-22 17:02:34 -03:00
David Capello
2be9403a48 Rename the Sentry crash handler to aseprite_crashpad_handler (#2857) 2021-12-21 13:40:38 -03:00
Joshua Ogunyinka
539e115b7d Fix colorbar palette indicator when view is changed (fix #3082)
The foreground/background color indicators in the ColorBar weren't
visible in certain scenarios e.g. If we choose the Tiles mode in a
tilemap, and then we select a regular layer without changing to Pixels
mode.

Co-authored-by: David Capello <david@igarastudio.com>
2021-12-16 20:37:29 -03:00
David Capello
0eef399ab9 Merge branch 'lua-errors' 2021-12-15 20:19:59 -03:00
David Capello
9340ca387d [lua] Minor change in error messages Websocket -> WebSocket 2021-12-15 20:19:26 -03:00
David Capello
91c687b1e3 Merge branch 'main' into beta 2021-12-15 17:51:19 -03:00
David Capello
977994765c Normalize some cmake options from WITH_* to ENABLE_* 2021-12-15 17:47:44 -03:00
David Capello
cf1678f4b3 Add optional & experimental support to load .psd file (only when ENABLE_PSD=on) 2021-12-15 17:44:51 -03:00
David Capello
72cf9c12f7 Merge branch 'beta-psd' into beta 2021-12-15 17:28:00 -03:00
Joshua Ogunyinka
1350cd92c3 Fix incorrect cel alignment 2021-12-15 16:06:00 -03:00
Joshua Ogunyinka
f567805591 Fix allowing alpha channel if layer is converted from indexed image (fix #3073) 2021-12-15 15:03:57 -03:00
lampysprites
3035d00283 [lua] Show errors that happen inside App.transaction 2021-12-12 19:20:12 +07:00
lampysprites
586b2493f9 [lua] Show more specific websocket errors 2021-12-12 18:57:51 +07:00
David Capello
e7575f2373 [lua] Fix crash using app.ranges.images/editableImages collections (fix #3069)
We were pushing invalid doc::Image objects to the Lua
stack (push_docobj<Image>) instead of pushing a ImageObj related to
the given cels in the active range.
2021-12-10 22:35:37 -03:00
David Capello
a2328a3793 Restore the previous active DocView when we close the non-active sprite
Fixes https://github.com/aseprite/aseprite/pull/2727#issuecomment-852524240
Close #2030, close #2727, close #3080, close #3089

Originally reported in:
https://community.aseprite.org/t/preview-file-to-save-when-closing/2779
2021-12-07 15:45:52 -03:00
MorganDavid
b96d8c8c30 Show user what is about to close (fix #2030) 2021-12-07 15:12:48 -03:00
Joshua Ogunyinka
b1d8da925c Add support for sprite slicing 2021-12-07 08:12:19 -03:00
Joshua Ogunyinka
174ec28638 Add support for frame-by-frame animation 2021-12-06 15:33:32 -03:00