Commit Graph

7329 Commits

Author SHA1 Message Date
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
Joshua Ogunyinka
5df21d96e8 Add support for layer groups 2021-12-06 15:33:32 -03:00
Joshua Ogunyinka
6e00c74f5b Add image processing scanline by scanline using iterators 2021-12-06 15:33:32 -03:00
Joshua Ogunyinka
7745921a2b Optimize image transparency detection 2021-12-06 15:33:32 -03:00
Joshua Ogunyinka
e5e9d59e56 Combine onImageScanline into one single function 2021-12-06 15:33:32 -03:00
Joshua Ogunyinka
9a12eb584b Initial to decode PSD files 2021-12-06 15:33:32 -03:00
Joshua Ogunyinka
ff851157cc Fix Shift+N behavior (fix #2957) 2021-12-02 17:33:10 -03:00
David Capello
2b57fcaa6c Merge branch 'main' into beta 2021-12-01 18:14:53 -03:00
Gaspar Capello
b5a787a20f Fix tilemap layers empty after converting color profile (fix #3052)
Before this fix, tilemap layers disappeared after converting the
Sprite's Color Profile in the Sprite Properties dialog.
2021-12-01 17:18:25 -03:00
Joshua Ogunyinka
3c7b344389 Save and retain color profile when saving palettes (part of #2893) 2021-12-01 09:21:02 -03:00
Omar Abdul Aziz
b30e64648e [lua] Dialog:modify() now supports combobox options
References:
* https://github.com/aseprite/aseprite/issues/2965#issuecomment-939556356
* https://github.com/aseprite/api/issues/61
2021-11-30 18:59:57 -03:00
David Capello
693a2c85ff Merge branch 'main' into beta 2021-11-18 13:41:18 -03:00
David Capello
d6339f163b Don't make SkinTheme surfaces slices immutable as we re-use them
Each time we refresh the default theme we re-use all slices/surfaces
of the SkinTheme. This could be completely avoided if we were able to
create sub-surfaces from the original sprite sheet (sharing the same
pixels).
2021-11-18 13:37:34 -03:00
David Capello
704c32ca25 Merge branch 'main' into beta 2021-11-17 14:46:48 -03:00
David Capello
f93b33f248 Migrate to Skia m96 API 2021-11-17 12:36:11 -03:00
David Capello
a713a88845 [x11] Fix initial black window on Linux
Possible regression introduced in f15589734f
2021-11-17 11:32:15 -03:00
David Capello
bed6a8d8b1 [lua] Increment API version 2021-11-16 09:08:39 -03:00
David Capello
c78af5241b Merge branch 'lua-filename-event' 2021-11-16 09:08:17 -03:00
David Capello
c13c521af2 Minor change in style 2021-11-16 09:07:50 -03:00
David Capello
8deb9c46e7 [lua] Fix clipping when drawing an image on a cel image (fix #3054) 2021-11-15 15:53:14 -03:00
Joshua Ogunyinka
12e61d33be [lua] Fix layer iteration when some layer name contains just a number (fix #3045) 2021-11-12 08:13:43 -03:00
lampysprites
67a9c2fe0d [lua] Add "filenamechange" event to Sprite.events 2021-11-11 20:18:44 +07:00
David Capello
a0bea17bc0 Avoid continuous redrawing events when moving mouse on Edit > Preferences listbox of sections 2021-11-05 12:41:53 -03:00
David Capello
ca252f9f02 Fix creating two ImageView if we specify "file" and "icon" for <image> widget 2021-11-05 12:15:24 -03:00
David Capello
9d61308bd6 Merge branch 'main' into beta 2021-11-02 14:22:29 -03:00
David Capello
43ca34bd35 Refactor updater::getUserAgent() using new base::get_platform() 2021-11-02 14:18:14 -03:00
David Capello
621bc209ac Merge branch 'main' into beta 2021-10-25 18:29:34 -03:00
David Capello
7cc9ea08ba Use https to get news items and check the latest version 2021-10-25 18:28:40 -03:00
David Capello
6c0842eaa5 Update copyright year in ver/info.c 2021-10-25 18:28:16 -03:00
David Capello
c4f2bf79a0 Merge branch 'main' into beta 2021-10-25 17:47:23 -03:00
David Capello
91e8e5cd46 Support scrolling the debugger source code viewport w/the mouse wheel 2021-10-25 17:40:47 -03:00
David Capello
534163ae5f Fix painting issues in the debugger filling the line number column correctly 2021-10-25 17:40:12 -03:00
David Capello
76a815cc2c Merge branch 'main' into beta 2021-10-20 11:53:47 -03:00
Martín Capello
c5fccb1499 Add a check to allow exit command execution only when the main window is the currently running 2021-10-20 11:35:54 -03:00
Gaspar Capello
f15589734f Fix double-clicking a .aseprite file in macOS Finder doesn't open the file anymore (fix #2985)
More info in: #3006
2021-10-20 11:05:24 -03:00
David Capello
ea703a38e6 [lua] Add "fgcolorchange" and "bgcolorchange" events to app 2021-10-19 15:18:13 -03:00
David Capello
4dcdcfe387 Fix deadlock destroying SpriteEvents disconnecting observers onCloseDocument
Instead of using an onDestroy(Document), which can be called from the
ClosedDocs background thread, we can disconnect all Doc observers on a
new onCloseDocument() event called from Doc::close() (from the UI
thread).

This deadlock issue was commented here:
https://github.com/aseprite/aseprite/pull/3009#issue-1029413592
2021-10-19 13:01:37 -03:00
David Capello
246b1930f4 Revert "Avoid deadlock of ClosedDocs and SpriteObserver"
This reverts commit 8c902dd8fc.
2021-10-19 11:56:36 -03:00
David Capello
5d04eb5a2e [lua] Match WebSocketMessageType constants with the style of all other constants 2021-10-19 11:15:00 -03:00
David Capello
5c30315611 Avoid std::bad_function_call if we don't specify an onreceive callback for the WebSocket 2021-10-19 11:12:15 -03:00
David Capello
c2f24656d7 Don't create a ui::Timer if the UI is not available 2021-10-19 11:11:57 -03:00
David Capello
651fa4a3b6 Stop the auxiliar ui::Timer when the last WebSocket is GC'd 2021-10-19 10:57:25 -03:00
David Capello
b29627c8cb Minor formatting change 2021-10-19 10:50:18 -03:00
lampysprites
6075285b5c Refactor the websocket timer 2021-10-19 12:23:12 +07:00
lampysprites
8c902dd8fc Avoid deadlock of ClosedDocs and SpriteObserver 2021-10-18 23:43:50 +07:00
lampysprites
1f9c2e8987 Handle socket messages when window is out of focus 2021-10-18 23:40:49 +07:00
lampysprites
93fb40ad7d Expose min/max time between websocket reconnects 2021-10-18 23:38:45 +07:00
Martín Capello
d1e02cc3c1 Add listitem support to the ui class generation tool 2021-10-15 10:44:30 -03:00
Martín Capello
e9e515c03f Add slider's "readonly" attribute support to widget_loader 2021-10-14 15:28:07 -03:00
David Capello
1e57cd267d Merge branch 'main' into beta 2021-10-13 10:42:20 -03:00
David Capello
6dd128d637 Add main_area in debugger window to show only the buttons initially 2021-10-13 10:35:55 -03:00
David Capello
d077900fe5 Merge branch 'main' into beta 2021-10-13 10:15:39 -03:00
David Capello
212e9fbe6c New initial Lua debugger version (#1967)
Incomplete version of the Lua debugger.
Some available features:

* Break in next executed instruction
* Step in, over, out
* See & navigate stacktrace
* See local variables

Some missing features:

* Breakpoints
* Eval user expressions with local variables

The UX needs some improvement yet.
2021-10-12 16:52:14 -03:00
David Capello
3de3ef5635 Minor change in widget_loader.cpp 2021-10-12 15:32:02 -03:00
David Capello
0b1ae09a63 Avoid exception using <textbox /> on .xml widget files
The exception was thrown using std::string(nullptr) constructor.
2021-10-12 15:30:16 -03:00
David Capello
9dbbcbd7ef Fix Theme::drawTextBox() to calculate the correct textbox size
If we are only calculating the textbox size (Graphics* g=nullptr) we
don't need to use the View scroll information anyway.
2021-10-12 15:28:57 -03:00
David Capello
db44eeb269 Merge branch 'main' into beta 2021-10-12 10:45:33 -03:00
David Capello
161264a78d Merge branch 'script-api-layer-is-reference' 2021-10-08 11:47:54 -03:00
David Capello
318d5ed6a0 Avoid removing random values from the Lua registry using Events:off()
Fix proposed in:
https://github.com/aseprite/aseprite/pull/2980#issuecomment-938495522
2021-10-08 11:09:47 -03:00
David Capello
2ddbbf00d6 Fix FileAccessMode::Full security value to include OpenSocket
Commented in:
https://github.com/aseprite/aseprite/pull/2980#issuecomment-938495522
2021-10-08 11:05:16 -03:00
David Capello
b9130b83f4 Merge branch 'interprocessing' 2021-10-07 19:38:23 -03:00
David Capello
6e84bb5443 [lua] Ask for permission to open a WebSocket from scripts 2021-10-07 19:37:10 -03:00
David Capello
b9241e6d91 Refactor ask_access() with ResourceType argument 2021-10-07 19:34:40 -03:00
David Capello
4cd137a639 [lua] Add Image.rowStride property now that Image.bytes is available
We need to know the specific rowStride to be able to set a proper
Image.bytes (bytes size = Image.height * Image.rowStride).
2021-10-07 19:10:27 -03:00
David Capello
cd342f5630 [lua] Add events handling with Sprite.events & App.events
Added a new Events object with :on() and :off() methods to start or
stop listening to a specific event respectively. This also allows to
add several callbacks for the same event.

Replaced the temporal Site.onChange & Sprite.onChange implementations.

Related to several issues (enable more possibilities for): #138, #1403, #1949, #2965, #2980
2021-10-07 18:56:39 -03:00
David Capello
0249275f8c [lua] Change MessageType to WebSocketMessageType
Just in case to avoid collision or confusion with some kind of future
MessageType (e.g. ui::MessageType). There are no plans for this, but
we prefer to use WebSocket* prefix.
2021-10-06 19:33:09 -03:00
David Capello
327b38a05d Wrap MESSAGE_TYPE_BINARY with parenthesis (...) 2021-10-06 19:29:19 -03:00
David Capello
0ca411690b Remove trailing whitespaces 2021-10-06 19:17:10 -03:00
David Capello
c117b1b01f Simplify Image_set_bytes(): as bytes_size == bytes_needed we don't need to call std::min() 2021-10-06 19:16:51 -03:00
Jeremy Behreandt
e0a747cad7 Expose Layer Is Reference
Exposes a getter for layer is reference in the Lua scripting API.
2021-10-06 14:04:54 -05:00
David Capello
f8dabfa294 Use portable memcpy instead of memcpy_s 2021-10-04 18:07:20 -03:00
David Capello
c1628e4c62 Fix crash clicking combobox scrollbar of dithering matrices in Dynamics popup (fix #2984)
We're trying to access the display() attribute of a kMouseDownMessage
message when the display was already deleted from Manager::_closeWindow.
2021-10-04 15:49:11 -03:00
lampysprites
2628afdfce Remove unneeded Sprite.__gc 2021-10-04 23:15:55 +07:00
lampysprites
bf53fa26cd Make onChange callbacks more predictable 2021-10-04 12:17:25 +07:00
lampysprites
a90853f765 Extend WebSocket API 2021-10-03 12:52:37 +07:00
lampysprites
4354be1d7a Add CMake option to disable websockets 2021-10-03 12:40:29 +07:00
lampysprites
711741a358 Remove unneeded lua stack pops 2021-10-03 02:22:15 +07:00
lampysprites
28595a410d Clean up sprite observers on lua GC 2021-10-02 22:10:25 +07:00
lampysprites
83c03a3158 Expose site observer to lua API 2021-10-02 20:09:35 +07:00
lampysprites
2aa3fdbd95 Execute websocket callbacks in the ui thread 2021-10-02 18:34:17 +07:00
lampysprites
22e3e6244a Simplify user API for Sprite observers 2021-10-02 16:22:31 +07:00
lampysprites
f8ef06a86e Lua API Image:bytes - convert lua Image to data string and back 2021-10-02 14:40:28 +07:00
lampysprites
b0f10ee276 Add Websocket client API 2021-10-02 13:57:51 +07:00
David Capello
33595c8bbb Merge branch 'plugin-onenabled' 2021-09-30 15:02:14 -03:00
David Capello
b5d230d52f Increment Lua API version 2021-09-30 15:01:57 -03:00
David Capello
1e92f66ff2 Remove trailing whitespace 2021-09-30 14:22:21 -03:00
David Capello
89904afa82 Simplify app::Job implementation
* Remove pointers to base::thread/mutex
* Use std::thread/mutex as values
2021-09-30 14:09:39 -03:00
lampysprites
e6aeee6400 Add IXWEbSocket library 2021-09-30 13:13:43 +07:00
Gaspar Capello
f32393bb31 Fix Canvas Size w/"Trim content outside" for tilemap layers (fix #2942)
New bounds for tilemap cels weren't calculated correctly when "Sprite >
Canvas Size" with "Trim content outside canvas" option was used.
2021-09-29 16:42:24 -03:00
David Capello
5238bfc7d7 Merge branch 'main' into beta (fix #2970) 2021-09-29 14:54:30 -03:00
David Capello
d7ddb7feed Fix changing random values to transparent color for non-indexed sprite from cmd::SetPalette
Possible fix for #2970
Possible regression introduced in dd2d226264
2021-09-29 14:42:55 -03:00
lampysprites
85f3164e21 Expose DocObserver to the scripts 2021-09-29 22:39:01 +07:00
David Capello
f318a42f19 Merge branch 'main' into beta 2021-09-29 10:16:02 -03:00
lampysprites
449c158f80 Implement enabledness check for script commands 2021-09-28 14:44:38 +07:00
David Capello
364f62ee4a Merge branch 'sentry' (fix #2857) 2021-09-23 21:09:27 -03:00
David Capello
f07dc53d83 Use our anonymous UUID to identify Sentry users 2021-09-23 21:06:19 -03:00
David Capello
c6c1393402 Show consent to share crash data only when there are something to share 2021-09-23 20:40:02 -03:00
David Capello
f6322a1373 Don't show "Aseprite is up to date" when there is no new version 2021-09-23 15:27:09 -03:00
David Capello
0c604ca4ba Ask for consent to share crash data 2021-09-23 15:22:26 -03:00
David Capello
6cafec8d06 Move Sentry class impl to a .cpp file 2021-09-23 12:55:30 -03:00
David Capello
775e8f86be Merge branch 'main' into beta 2021-09-23 09:19:23 -03:00