Commit Graph

9104 Commits

Author SHA1 Message Date
Gaspar Capello
f3ed22e1a6 [lua] Add Image:flip() 2023-05-18 13:02:07 -03:00
David Capello
66ac837305 Fix brush and pasted image preview on empty cels (fix #3882)
Fix regression introduced in 24846eae10
using the new RenderPlan structure. We have to include empty/nullptr
cels in the plan to paint the preview image in the selected
layer/frame (the preview image is the one used for the brush preview,
and for the transformation preview when we paste the clipboard content
on the canvas).
2023-05-18 12:56:09 -03:00
David Capello
da70dd3892 Increment scripting API version 2023-05-18 12:42:35 -03:00
David Capello
c26351712a [lua] Add new 'beforepaintemptytilemap' app event
Now a tileManagementPlugin can customize the creation of empty tiles
when the user starts drawing on an empty cel.

To implement: https://github.com/aseprite/Attachment-System/issues/119
Related to: https://github.com/aseprite/Attachment-System/issues/127
2023-05-18 12:40:12 -03:00
David Capello
d329f38075 [lua] Add stopPropagation function to the beforecommand event
Related to:
https://github.com/aseprite/Attachment-System/issues/121
https://github.com/aseprite/Attachment-System/issues/127
2023-05-18 11:49:04 -03:00
David Capello
961dee4354 [lua] Add 'beforecommand' and 'aftercommand' app events
This will allow to implement custom horizontal/vertical flip:
https://github.com/aseprite/Attachment-System/issues/121

Related to:
https://github.com/aseprite/Attachment-System/issues/127
2023-05-18 11:29:23 -03:00
David Capello
63592f3e04 Update laf 2023-05-18 09:34:05 -03:00
David Capello
d5406cbc55 Fix bug reading UUID property from backup data/undo data 2023-05-17 12:36:17 -03:00
Gaspar Capello
398ca95392 Fix timeline is not repainted/invalidated when we switch onion skin option (F3 key) (fix #3806) 2023-05-16 14:30:08 -03:00
David Capello
9a915355c5 Update fmt library to 10.0.0 2023-05-15 18:54:46 -03:00
David Capello
a6ccc45d5b Fix crash calling app.command.LoadPalette() when the UI is not available (fix #3847)
E.g.

  aseprite -b -script load.lua

When load.lua is:

  app.command.LoadPalette()

Was crashing the program.
2023-05-15 17:31:46 -03:00
David Capello
7a26281ce3 Change all selected cel properties when we select frames/layers (fix #3807)
The Cel Properties dialog wasn't working right when we selected a
range of layers or frames.
2023-05-15 15:20:16 -03:00
Martín Capello
c902c563e3 Fix crash in app::tools::BaseInk::prepareForPointShape (fix #3338) 2023-05-15 14:38:58 -03:00
Martín Capello
6ab1b2c653 Revert "Fix crash in app::tools::BaseInk::prepareForPointShape" because it breaks other tools functionality (fix #3869) 2023-05-15 14:35:39 -03:00
David Capello
691f99a291 Delay filter preview start to group several mouse events/param changes in one
This is needed on X11/Linux as we received a lot of mouse events at
the same time when the user drag the mouse. In this way we avoid
restarting the preview and making a high CPU usage just to stop/start
the filter without any kind of UI feedback.
2023-05-15 14:31:08 -03:00
David Capello
59f6b78e4f Use a task_token to cancel a filter when we are processing a row
Added FILTER_LOOP_THROUGH_ROW_BEGIN/END macros to simplify some
boilerplate code for each filter.

In this way if processing just one row takes too much time, canceling
the operation is faster.
2023-05-15 13:23:24 -03:00
David Capello
87075296ed Use app::Task instead of raw threads on FilterPreview
We can use a thread pool (avoid creating/destroying threads) and we
can continue the same task running when the filter restart (there is
no need to stop/wait and restart, because the filter task keeps
calling the applyStep() function anyway).
2023-05-12 10:22:10 -03:00
Gaspar Capello
2369f36322 Enable panning and zooming for filter window (fix #2563)
Now we can zoom and pan on Replace Color, Color Curve, Outline,
Convolution Matrix, etc. which are Filter Windows.
2023-05-11 18:01:36 -03:00
Martín Capello
72d518c5e2 Fix crash in app::tools::BaseInk::prepareForPointShape (fix #3338) 2023-05-11 12:35:51 -03:00
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