Commit Graph

7987 Commits

Author SHA1 Message Date
David Capello
c4526cf709 Remove ENABLE_UI option (#4619)
Now we use the LAF_BACKEND=none/skia to detect if it's going to be the
CLI/GUI version of the program. The ENABLE_UI flag is still defined at
compile-time just to avoid removing all #ifdef/endif conditional
directives right now.
2024-09-02 18:17:23 -03:00
Gaspar Capello
8323a55500 Fix Cancel command do not work on scripting
Before this fix, the 'Cancel' command did not work in the following
specific situation:
As soon as Aseprite was started and without hitting the 'Esc' key,
the 'app.command.Cancel()' command did not perform any operation.

It was discovered that the Cancel command is started only once per
session and retains the 'm_type' throughout the session. Only
a specific:
app.command.Cancel {type = "all"} or
app.command.Cancel {type = "noop"}
could change the command type.
2024-08-29 10:50:03 -03:00
دانتي باولا
dd208ebe5d
Use right click action with shading ink (fix #4520) (#4615) 2024-08-29 10:45:52 -03:00
David Capello
e87f6df72b Avoid loading current dithering matrix on each mouse move (related to #4174)
With this change we are reusing the cached/loaded matrix on each
DitheringMatrixInfo struct, calling the
load_dithering_matrix_from_sprite() function just one time (not on
each brush preview/mouse movement).
2024-08-21 19:49:55 -03:00
David Capello
7b24cf2594 Fix "New Frame" button for existing third-party themes (fix #4609)
We made an attempt to change the "+" character with an icon, but we
cannot use an existing style to do this kind of change in themes (as
third-party themes will be using the old version of the style, not the
updated one).

We're reverting part of the change introduced in
e0ff51947a to use the "+" character for
this "New Frame" button in the status bar.
2024-08-21 16:55:11 -03:00
David Capello
1ca4306f9d [win] Fix File > Export > Export As to other drive (fix #4607)
This only affects the Windows platform.
Regression introduced in db639072f7
2024-08-21 13:50:29 -03:00
David Capello
8817724e44 Fix typo using ENABLE_I18N_STRINGS var 2024-08-19 20:08:56 -03:00
Martín Capello
712d84e44e
Avoid div by zero by preventing entering/returning a grid bounds w/zero width/height (fix #4146, #4597) 2024-08-19 18:07:40 -03:00
Christian Kaiser
4df11ac1e3
Reset mask when clicking outside of bounds with the magic wand tool (fix #4490, #4595) 2024-08-15 09:13:18 -03:00
David Capello
4e5dfa9d2c Don't export cel opacity when it's 255 (#4511 / #4552)
In this way we don't modify the current exported JSONs by users that
are not using cel opacity (which might be the most common case).
2024-08-08 19:02:51 -03:00
requizm
a11946ab0e Added opacity field when exporting a cell 2024-08-08 18:57:30 -03:00
Christian Kaiser
e0ff51947a
Add new frame menu to status bar button (#4582) 2024-08-08 17:23:41 -03:00
Gaspar Capello
8f3af748b9
Don't allow to install third-party themes that override the default one (fix #4226) (#4335)
This 1) hides user themes whose name is the same as the default,
and are present in the user folders (i.e.  'extensions' and
'data/themes' folders), and 2) doesn't allow to install themes with
the same content/ID of the default aseprite-theme (fix #4226)
2024-07-29 16:02:05 -03:00
requizm
b65fb3a14e Fixed size calculation on resize_image 2024-07-25 17:59:31 -03:00
David Capello
26279597b6 Add help button "?" in some windows (fix #1980)
We hope to enhance the discoverability of Aseprite features in this
way.
2024-07-25 16:02:21 -03:00
David Capello
9da10605d3 Remove duplicate code with new sort_slices_by_name() function 2024-07-19 16:47:13 -03:00
requizm
6047ab69de [ui] Fixed slice order in File > Export > Export As > Area 2024-07-04 14:22:51 -03:00
David Capello
064ddef190 Don't clone strings repository by default (fix #4489)
New ENABLE_I18N_STRINGS option (off by default) to avoid compilation
errors cloning the strings repo (no connection, no git, etc.).
2024-06-27 08:35:55 -03:00
David Capello
abe872aeb2 Convert the tileset serialization format in its own type
To match the new SerialFormat enum (uint16_t), we now have
TilesetSerialFormat enum (uint8_t).
2024-06-26 11:24:09 -03:00
David Capello
cdea6004bd Refactor app::DocFormat to doc::SerialFormat
This fixes a violation of module layers (circular dependency)
introduced in e6cd13d7e1 where doc-lib
started to depend on app-lib (which cannot happen, as app-lib depends
on doc-lib).

This DocFormat/SerialFormat was used only from app-lib previously, but
when properties were introduced in user data, the serialization format
version was needed to read user properties too. So now it makes sense
to move this type/its values to the doc-lib.

A couple of extra issues were found in this refactor:
1) The recursive call inside read_layer() didn't receive this "serial"
   argument
2) read_grid() doesn't need the setId parameter
2024-06-26 10:42:30 -03:00
David Capello
32a099dcb6 Fix crashes with ill-formed fmt format strings (fix #2274)
There is a third-party translation (and can happen with our own
translations) that a fmt format string is ill-formed in the .ini file
of the translation (this could happen even if the en.ini file was
manually modified/broken by hand).

This patch includes a refactor of the Strings class so we can:

1) Static check at compile-time about the number of required arguments
   to format a string (no need to call fmt::format() directly with
   arbitrary number of args)
2) If a string is not valid for the fmt library, the runtime exception
   is caught and the default (English) string is returned.
2024-06-20 20:49:10 -03:00
David Capello
3d50a85d14 Fix mipmaps options when downsampling (fix #4317) 2024-06-19 20:51:02 -03:00
Guilherme Marcondes
db639072f7 Show relative path when exporting sprite (fix #4059)
When exporting a file that was already saved, shows the relative path
to the original path instead of only the filename.
2024-06-19 12:57:51 +01:00
David Capello
9fb0ee620c [x11] Don't use ui::move_region() to move windows on X11
It's quite slow, it's faster just to repaint the background.
2024-06-18 15:24:22 -03:00
David Capello
2e58e70f1c Remove unused header file from ui/widget.cpp 2024-06-18 15:18:23 -03:00
David Capello
f21c9f2dce [x11] Move the user-defined pattern to detect pens to TabletOptions 2024-06-18 15:18:08 -03:00
David Capello
7d63ceb199 Remove System::tabletAPI() function 2024-06-18 14:02:37 -03:00
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
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
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
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
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