Commit Graph

9085 Commits

Author SHA1 Message Date
David Capello
c32b9b07a8 Centralize the warning message for incompatible files/forward compatibility (#3811, #3812)
Several changes were included:
- Fixes in TextBox widget to show it with proper size hint when it's
  outside a viewport
- Added the IncompatFileWindow with a message + link to know how to
  update Aseprite and solve the situation
- Moved CannotModifyWhenReadOnlyException from app/doc.h to
  app/transaction.h
2023-05-11 12:18:31 -03:00
David Capello
77cdbf4739 Fix Widget::setTransparent(false) 2023-05-10 14:54:21 -03:00
David Capello
10cdad9c58 Avoid crashes in the Timeline if the sprite hasn't any layer
Given 32ed6622d4, now we could be in a
situation where the sprite is loaded without layers because all layers
are incompatible with the current version. So we have to take care of
this situation in the Timeline UI.
2023-05-09 22:08:37 -03:00
David Capello
32ed6622d4 Mark unknown layer/cel/chunk/color profile types as incompatibility errors 2023-05-09 22:06:13 -03:00
David Capello
387b46d72b Minor formatting changes
Don't call fmd::format() or c_str() when it's not needed.
2023-05-09 21:58:54 -03:00
Martín Capello
3f581a5dfa Add warning when loading unsupported property type and mark the file as read-only (fix #3812, fix #3811) 2023-05-08 17:37:05 -03:00
David Capello
66efb35a8c Add test to save UUID properties on .aseprite files 2023-05-08 17:13:44 -03:00
Martín Capello
da80192d0f Add UUID type to user properties (fix #3810) 2023-05-08 17:13:34 -03:00
David Capello
948bf98b86 Saving a non-sequence file type (aseprite/gif/webp/fli/etc.) must create all required directories too 2023-05-08 16:22:42 -03:00
David Capello
d75424fe87 Simplify iteration of frames in WebPFormat::onSave() 2023-05-08 16:22:41 -03:00
Gaspar Capello
afbede3eae Fix webp export to export one tag correctly instead of all frames (fix #3622) 2023-05-08 16:22:31 -03:00
David Capello
dbfc7d745f Minor change to specs: put Notes in the table of content 2023-05-08 12:37:10 -03:00
David Capello
943f0df625 Add info about how to order layers depending on z-index in the specs 2023-05-08 12:14:45 -03:00
David Capello
8e91d22b70 Fix experimental "nonactive-layers opacity" mode for the SimpleRenderer
Regression introduced in 24846eae10
2023-05-05 22:11:19 -03:00
David Capello
8cdb4edcac Fix bug where we were able to click a non-foreground window
With multiple windows on, if a modal/foreground window like Canvas
Size (which has a special onBroadcastMouseMessage()) were running, and
there was a script dialog also opened on the background, the
non-foreground dialog could receive clicks. This patch fixes this
particular scenario (no other window than the actual foreground window
can receive mouse clicks).
2023-05-05 20:08:39 -03:00
David Capello
b5f262f423 Integrate fixes for Cyrillic script in Aseprite font (fix #3797) 2023-05-01 19:53:43 -03:00
David Capello
25cb258f76 Wrap all TRACE() calls in data recovery functions with RECO_TRACE()
In this way we can completely disable the log of data recovery events.
In a future we might offer a way to log all these events in a log file
(probably included in crash reports).
2023-05-01 19:22:53 -03:00
David Capello
b7f06c1366 [devmode] Ctrl+Shift+R shortcut is available in devmode (debug can be on or off) 2023-05-01 19:18:23 -03:00
David Capello
10ea91cb52 Fix crash saving user brushes in unknown situations (fix #3728)
We've received crash reports where save_xml() throws an Exception()
because the user brushes file cannot be saved (open_file(..., "wb")
returns nlulptr). We're not sure why (probably privileges?) but at
least we fixed the exception.
2023-05-01 10:57:37 -03:00
David Capello
4d3575f4ce Fix crash when an extension adds a command in a non-existent menu group (fix #3835) 2023-05-01 10:50:53 -03:00
David Capello
bfe4669c0e [devmode] F1 key switches the renderer only when pressed w/o modifiers 2023-04-27 11:44:11 -03:00
Martín Capello
0958573cac Add canvas autoScaling feature (fix #3748) 2023-04-27 11:07:26 -03:00
David Capello
067309f776 Fix crash decoding huge .aseprite files
Now we don't allocate an huge temporal array of width x height x bytes
per pixel to store uncompressed data per image.

Reported by an user editing a 35000x35000 canvas. Similar to
https://community.aseprite.org/t/vector-too-long-empty-file-and-lost-work/6844

Internal report: https://igarastudio.zendesk.com/agent/tickets/4703
2023-04-26 16:30:04 -03:00
David Capello
1c75092e13 Fix crash w/double backToPreviousState() when the state after app.editor:askPoint() is canceled from the script 2023-04-25 19:55:32 -03:00
David Capello
9b76f95b15 Fix Left/Right keys to move through frames in FramesSelection context (fix #3821) 2023-04-25 10:38:49 -03:00
David Capello
a9207524ff Minor refactor in code to handle keys
Added CustomizedGuiManager::processKey() member function.
2023-04-25 10:30:39 -03:00
David Capello
f655d57069 [lua] Add app.editor.spritePos/mousePos and app.editor:cancel()
Added properties needed to know where the mouse position is on the
editor canvas + a method to cancel app.editor:askPoint() from Lua.

Related to aseprite/Attachment-System#102
2023-04-25 09:03:20 -03:00
David Capello
2baf291b4a [lua] Add "point" argument to app.editor:askPoint() for initial point
Related to aseprite/Attachment-System#102 and could be used for
aseprite/Attachment-System#103
2023-04-24 23:11:09 -03:00
David Capello
72dbcf51d1 [lua] Add onchange event to app.editor:askPoint()
Related to aseprite/Attachment-System#102
2023-04-24 22:48:30 -03:00
David Capello
ff4d60bd09 [lua] Add app.editor:askPoint() (fix aseprite/Attachment-System#102) 2023-04-20 11:14:14 -03:00
David Capello
d7af7f4312 [lua] Add new app.editor object (fix aseprite/Attachment-System#104) 2023-04-19 19:10:28 -03:00
David Capello
622b02294a [lua] Add short field names (fix #3815, fix #3816) 2023-04-19 13:48:15 -03:00
David Capello
6cbde57470 Add gridBounds parameter to NewLayer command 2023-04-19 13:25:54 -03:00
David Capello
1c6e583c87 [lua] Add require() function (fix aseprite/api#10)
This is the first attempt to finally implement the require() function
on Lua. The main problem was how to solve conflicts between plugins
that use the same library name. Here we separate each plugin like in a
namespace, so require(name) inside a plugin will save the module in
_LOADED["pluginName/libraryName"] to avoid conflicts with other
libraryName from other plugins.
2023-04-18 19:41:01 -03:00
David Capello
8ff62f7a5f [lua] Add Uuid tests
Missing file from 636cce6f0d commit
2023-04-18 07:41:32 -03:00
David Capello
f0e80f1b5a Fix failing ASSERT(i >= 0 && i < int(m_states.size())) in ListBox::selectChild()
We receive kMouseMoveMessage as the first message of a multiselect
message in a ListBox when the kMouseDownMessage message is received by
a separator first e.g. if we click a separator from the Recover Files
tab and start dragging the mouse this assert was failing.
2023-04-17 22:32:22 -03:00
David Capello
79745756ef Fix bug removing submenu-groups inside menu-groups created by plugins
Before this the ASSERT(group.items.empty()) in
AppMenus::removeMenuGroup() was failing when a plugin created
subgroups/submenus inside groups.

We have to remove plugins items in the reverse order that they were
added to uninstall them correctly.
2023-04-17 20:12:31 -03:00
David Capello
172e1a615b Respect z-index layer ordering when there are empty cels
An empty cel must be counted as a layer for the z-index ordering, so
the z-index refers to number of layers to move back/front, but number
of non-empty cels in the specific frame.

A this fix, a new issue appears: #3820
2023-04-17 19:24:20 -03:00
David Capello
2962bb3676 Fix save-as-with-slice CLI test as output files are listed in order 2023-04-14 14:05:51 -03:00
David Capello
b28550faf5 Use new ScopedValue w/o old arg + C++17 class template argument deduction (CTAD) 2023-04-14 13:43:36 -03:00
Gaspar Capello
d4d18c99be [lua] Add Image:clear(Rectangle, color) overload (fix #3799)
We can use:

  Image:clear()
  Image:clear(color)
  Image:clear(rectangle)
  Image:clear(rectangle, color)

If the color is not specified it will be the transparent color of the
image.

Co-authored-by: David Capello <david@igara.com>
2023-04-12 15:30:12 -03:00
David Capello
89ced2e557 Add test for -save-as {slice} (#3801, #3802)
Original report: https://community.aseprite.org/t/17692
2023-04-12 15:11:37 -03:00
Gaspar Capello
17b976b3aa Fix regression {slice} format on CLI doesn't work (fix #3801) 2023-04-12 15:00:40 -03:00
Martín Capello
8841f3da32 Move window relayout before inserting the window to the manager (fix #3746)
This is necessary to prevent the manager to invalidate a window whose relayout is not finished. This can happen when a script opens a new window when another is currently opening. For instance a script whose canvas.onpaint handler opens another dialog.
2023-04-12 14:10:45 -03:00
David Capello
636cce6f0d [lua] Add Uuid type (fix #3809) 2023-04-12 13:51:37 -03:00
David Capello
7104a1a449 F2 renames the layer if a range of frames is not selected (fix #2326)
In this way we can use F2 to:

1. Set the Loop section if two or more frames are selected
2. Remove the loop section if only one frame is selected
3. Rename the active layer if the layer is selected (or no frames are selected)
2023-04-11 19:04:45 -03:00
David Capello
24846eae10 Add z-index property to cels (fix aseprite/Attachment-System#88)
* Now a Cel has a z-index property to change the order of layers per frame
* A new doc::RenderPlan class can calculate the order of cels to be rendered
* z-index is saved as a int16_t in the .aseprite files
* This new field can be set/get from Lua with Cel.zIndex
2023-04-10 19:23:16 -03:00
David Capello
e38398d7aa Fix compilation when ENABLE_DEVMODE is disabled
We don't compile ShaderRenderer in production yet.
2023-04-07 21:36:04 -03:00
David Capello
538219f655 Fix warnings about unused members w/ImageIteratorT
Mainly when compiling src/doc/algorithm/rotate.cpp
2023-04-07 21:11:56 -03:00
David Capello
4f80008ea7 Merge branch 'gpu' (#3516, #3523)
An initial implementation (not yet ready for production) of the
ShaderRenderer to use SkSL shaders to convert indexed -> RGB, and draw
SkImages directly on SkCanvases (this will enable future GPU
acceleration).
2023-04-07 20:35:07 -03:00