Commit Graph

7652 Commits

Author SHA1 Message Date
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
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
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
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
2d825db6ac Update laf module 2022-02-17 10:57:49 -03:00
David Capello
631b574c0c [win] Use Windows pointer API and disable wintab32 by default (fix #2785)
This is a long standing issue, Wintab drivers crashes too often and
randomly. We've received 33 crashes from 14 different users so far
from Sentry (without counting the amount of user support we've already
done and special switches, etc.).

More info:
https://www.aseprite.org/docs/wintab/
https://github.com/aseprite/aseprite/issues/2785#issuecomment-1033222868
https://sentry.io/organizations/igara-studio/issues/2928831157/
2022-02-17 10:55:18 -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
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
9e23d31d84 Fix crash using Shift key in Pencil tool
Bug introduced in f3fd0de3d0
2022-01-13 08:43:03 -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
8295afbfe2 Update laf module (fix #3125) 2022-01-12 08:23:03 -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
de40d53aac Update laf module 2022-01-11 11:57:36 -03:00
David Capello
8a9206a757 Update laf module 2022-01-10 17:00:58 -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
06cfbd794e Use DelayedMouseMove for MovingCelState too (#3119) 2022-01-06 18:43:12 -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
bc22073a4e Update laf module 2022-01-05 20:14:56 -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
3fba303291 Define some variables for Sentry when using curl as transport 2021-12-22 17:03:16 -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
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
977994765c Normalize some cmake options from WITH_* to ENABLE_* 2021-12-15 17:47:44 -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
David Capello
de768a020d Use Skia freetype & harfbuzz when LAF_BACKEND=skia 2021-12-01 18:14:18 -03:00