Commit Graph

9581 Commits

Author SHA1 Message Date
David Capello
f29ec83c6c [win] Fix sync between mouse cursor <-> stylus cursor (fix #4539)
Added a new option (enabled by default) to set the mouse cursor when a
pen/pointer message is received. This fixes a couple of issues:

1) When we zoom in/out with keys or scrolling the trackpad, the last
   known position will be used (the pen position if we are using the
   pen).

2) If we are recording the stream/live streaming with a software like
   OBS Studio, the cursor position will correctly be in the pen
   position if we're painting with the pen.
2024-06-18 13:44:19 -03:00
David Capello
2827618786 [gpu] Fix outdated os::Surface to show latest changes on the canvas
We have to mark the SkBitmap as modified (new generation ID) in
convert_image_to_surface() so we upload the bitmap changes as a new
texture in the GPU.
2024-06-17 14:11:14 -03:00
David Capello
84942175ca [gpu] Avoid reading pixels from a GPU surface to move a window
On CPU we might try to blit the old content of the window in a new
location, but with a GPU this operation is super slow, it's fast just
to draw everything again.
2024-06-14 21:01:25 -03:00
David Capello
2c7fc767bf Update GPU flag correctly on all display when it's changed 2024-06-14 20:07:05 -03:00
David Capello
533fb778f3 Reorganize compilation flags in CMakeLists.txt files
* Moved flags that only app-lib uses from add_definitions() to
  target_compile_definitions()
* Curl flags for TLS moved from third_party to root CMakeLists.txt (as
  they were defined in both places)
2024-06-12 17:43:43 -03:00
David Capello
8f7bf09263 Fix doc::blend_image() to support different color modes (fix #4530, fix #4531)
The code was refactored moving the BlenderHelper class from "render"
to "doc", and now doc::blend_image() supports blending different color
modes.

Some work is still needed to work with grayscale images correctly.
2024-06-11 21:48:57 -03:00
David Capello
31f3c79566 Update submodules 2024-06-10 19:27:36 -03:00
David Capello
927a24bb18 [ci] Remove workaround for windows-2022 runner and cmake 3.25.0
Reverts 63a9aa67c9
2024-06-10 17:33:59 -03:00
David Capello
6cdf2ae2df [ci] Change jobs matrix
Compile with ENABLE_UI=ON/OFF (gui/cli) and
ENABLE_SCRIPTING=ON/OFF (lua/noscripts) variants on all platforms.
2024-06-10 17:21:17 -03:00
David Capello
2ed584541b [msvc] Use a workaround to fix compiler bug (fix #4526)
Reported in https://developercommunity.visualstudio.com/t/Invalid-optimized-x64-codegen-with-inlin/10678815
possible duplicated of https://developercommunity.visualstudio.com/t/Optimisation-of-right-bit-shift-switches/10453852
not yet available in official VS release.

Here we changed signed ints to unsigned ints to avoid this bug.
2024-06-10 08:59:10 -03:00
David Capello
a41644f6b5 Reword and add more information to the contributing guide 2024-06-07 14:29:38 -03:00
David Capello
9b50f0bbd5 [ci] Change comment-on-pr action to IdanHo/comment-on-pr
This is the exact version that SerenityOS uses, it looks like it can
comment on Aseprite issues, while the original
one (unsplash/comment-on-pr) cannot, giving us the following error:

  Couldn't find an open pull request for branch with head at .
2024-06-07 13:50:14 -03:00
David Capello
ae63c633b4 [ci] Add commit linter action 2024-06-06 16:25:03 -03:00
requizm
aa152963d4 [cli] Add -list-layer-hierarchy option
Example output:
group1/
  layer1.1
  layer1.2
  group1.1/
    layer1.1.1
group2/
  layer2.1
2024-06-06 11:30:01 -03:00
David Capello
7ce9f85b39 [lua] Fix bug comparing integers and floating points (fix #4516)
This bug was introduced in:

  db8284f5fc

We've removed the patch in our updated Lua v5.4.6 branch.
2024-06-03 11:39:16 -03:00
David Capello
d72be3f354 Update laf module 2024-06-03 09:05:24 -03:00
Jakub Marcowski
0c9966df98 zlib: Update to 1.3.1 2024-05-29 10:33:26 -03:00
Martín Capello
24e72a36ba Add --play-subtags CLI test 2024-05-28 15:00:22 -03:00
Martín Capello
88ef46de42 Add new CLI param to save animations taking into account subtabs and repeats (fix #4297) 2024-05-28 15:00:22 -03:00
Gaspar Capello
1896483458 Fix crashing segfault when calling: app.command.CloseFile() or app.command.GotoPreviousTab() , in --batch mode (fix #4352) 2024-05-28 13:35:55 -03:00
Gaspar Capello
02e8d97eed Fix drop pixels when drag/modifying tag range while transform state is active (fix #4375)
Before this fix, the "cannot modify sprite/cannot lock sprite" message
was displayed instead of just dropping pixels.

Co-authored-by: David Capello <david@igara.com>
2024-05-28 12:25:10 -03:00
Martín Capello
f4b8effd52 Use ui::Style* instead of strings in ButtonSet::addItem() (fix #4188) 2024-05-28 09:30:54 -03:00
Gaspar Capello
611713e5fc Fix CounCountour Tool: pixel perfect doesnt work after a straight line (fix #4256) 2024-05-28 07:47:59 -03:00
Gaspar Capello
dd9f1ce988 Fix crash when previewing a sprite sheet export when selecting an empty layer group located at the bottom of the layer stack in the "Layers" combo box. 2024-05-27 20:22:36 -03:00
Guilherme Belchior
531b2ded75 fix #4217: Disable mouse stabilizer while previewing a straight line
This commit addresses the issue where the Shift+brush tool was not disabling the mouse stabilizer, leading to unintended behavior when previewing a line. This commit adds the necessary implementation to properly disable the stabilizer when Shift+brush tool is used. Additionally, the function DrawingState::disableMouseStabilizer() now calls ToolLoopManager::disableMouseStabilizer() to ensure the stabilizer is disabled correctly.
2024-05-23 15:00:39 -03:00
David Capello
1f529bd610 Fix a couple of bugs restoring backup sessions
With https://community.aseprite.org/t/layers-become-empty-when-autosaving/22141
we found a couple of bugs where only 2 backed up versions of stored
objects were added in ObjVersions::add().

Also as ObjVersions has a limited space for 3 versions, it's a good
idea to ignore invalid binary files (files without the magic number
"FINE" as header). So now we only add valid versions to ObjVersions,
previously we could lead to a situation where 3 invalid binary
versions of the same object were added to the ObjVersions and a 4th
valid version were ignored.

Related to: https://github.com/aseprite/aseprite/issues/4481
2024-05-23 12:45:31 -03:00
David Capello
577f50b713 Fix crashes using flood fill algorithm in a large canvas (fix #4481) 2024-05-23 10:56:05 -03:00
David Capello
8fce589069 Now updater-lib is always compiled as it's required for app.os.fullName in scripts (fix #4486)
ENABLE_UPDATER flag now only controls the "check update" portion of
the updater-lib. Probably the user agent string could be moved to the
ver-lib in the future.
2024-05-22 12:41:23 -03:00
David Capello
c44040fdc7 Update laf module 2024-05-20 22:07:52 -03:00
David Capello
2596d44732 Fix incorrect diff between layers debugging the restoration of a backup (TEST_BACKUP_INTEGRITY)
Only in debug mode with TEST_BACKUP_INTEGRITY flag, we now don't
detect as a layer diff between the doc in memory and the restore doc
from backup if only some layer flags like visibility/collapse changed.
2024-05-20 22:04:21 -03:00
David Capello
3ea0437e1d Add "recent" param to SaveFile/ExportSpriteSheet to avoid adding the file to the list of recent files 2024-05-10 15:20:32 -03:00
David Capello
0cc1161d64 Disable progress bar in commands that can receive ui=false (fix #4165) 2024-05-09 14:34:48 -03:00
David Capello
a1bd6f59aa Update cmark module 2024-05-08 14:52:39 -03:00
David Capello
6f09bde511 Allow backslash (\) in filenames on Linux and macOS (fix #3936)
We required a new app.os object to skip some tests on non-Windows
platforms when we check for backslashes in app.fs functions.
2024-05-08 14:46:16 -03:00
David Capello
30a4000c7c Disable tinyxml2 tests 2024-05-08 09:59:21 -03:00
Gaspar Capello
805a8259a1 Fix wrong alignment between mouse and sensor threshold position (fix #4428) 2024-05-06 10:52:21 -03:00
David Capello
92edd5f700 Add Brush::clone() functions to fix/simplify some Brush-related code
This refactor includes:

- In Lua now we can clone a custom brush with Brush(Image) and the new
  brush doesn't share the image with the original one (added a new test
  for this).

- Avoid creating extra images when it's not needed using
  Brush::cloneWithExistingImages() (we can inject existing images in
  the brush itself).

- Delete Brush-copy contructor & assign operator to use
  Brush::clone() functions instead (which are more explicit).

- Some code from 12d8135264 (#4023)
  reverted to avoid recreating brushes on left-click or in the brush
  preview, i.e. moving the mouse (#4013 refers only to right-click, so
  only on right-click we have to adjust the custom brush).
2024-05-03 11:35:36 -03:00
Gaspar Capello
12d8135264 Fix secondary color with custom brush paints the FgColor instead the BgColor (fix #4013)
Before this fix to change the main color of the image brush,
it was necessary to choose a new color from the palette.
The secondary color can now also be used.

Also added some tests for image brushes.
2024-04-29 17:20:56 -03:00
David Capello
2942abae3e Fix get-ninja action 2024-04-26 18:15:52 -03:00
David Capello
648ff61d1a Update laf module 2024-04-22 18:46:59 -03:00
David Capello
e48e71ba28 Update to tinyxml2 2024-04-22 18:28:03 -03:00
David Capello
4d18200b0c [lua] Fix bugs handling errors inside app.transaction()
This errors was reported in #4431: The Tx wasn't rolled back correctly
in case of a Lua error inside the transaction because Lua needs to be
compiled as C++ to avoid longjmps and support stack
unwinding (i.e. calling destructors).
2024-04-22 11:13:10 -03:00
David Capello
d1ea2eaff1 Avoid warnings about redefining LUA_USE_WINDOWS 2024-04-21 22:43:24 -03:00
David Capello
0b55dcdb3a [lua] Close stdin handle when we start running the GUI 2024-04-21 22:37:51 -03:00
David Capello
cd211ba0fd [lua] Ask permissions for io.lines/input/output functions 2024-04-21 14:31:17 -03:00
David Capello
7172de5007 [lua] Use internal variables to store ptrs to original unsecure functions
Instead of using Lua upvalues/closures.
2024-04-21 13:25:56 -03:00
David Capello
53bb6aceec [lua] Disable loadfile() without args in GUI mode
Waiting for stdin input will hang the program.
2024-04-21 13:14:09 -03:00
David Capello
f64e8065e7 Update laf module 2024-04-15 11:49:44 -03:00
Gaspar Capello
99e6e7bd82 Fix nested tag with "Ping-Pong" repeat mode causes to skip the first frame of the parent tag (fix #4271) 2024-04-12 10:41:18 -03:00
David Capello
d886e20f6c [lua] Secure io.popen() access (and enable popen on Linux) 2024-04-10 12:01:29 -03:00