Commit Graph

9007 Commits

Author SHA1 Message Date
Gaspar Capello
637632eafb [lua] Add blend modes to Image:drawImage() 2023-03-27 20:31:58 -03:00
David Capello
ff9f60a8be Add more glyphs to aseprite_font.png (Cyrillic script is back)
Some glyphs are from an old Aseprite version with Cyrillic alphabet,
but I have complete it with some extra chars (e.g. Maltenese #3699).
Still a work-in-progress.

Related to:
https://community.aseprite.org/t/russian-language-aseprite/1851
https://community.aseprite.org/t/cyrillic-font-on-macos/4078
2023-03-27 19:49:40 -03:00
David Capello
af9f7288ee [lua] Add 'ondblclick' event for canvas widget 2023-03-27 14:22:10 -03:00
David Capello
11abe10c20 Add ability to use mnemonic without modifiers in alerts
Requested in https://community.aseprite.org/t/16845
2023-03-23 16:15:51 -03:00
David Capello
53c851c547 [lua] Add GraphicsContext:oval() function 2023-03-23 14:56:01 -03:00
David Capello
44729b27a7 Fix compilation when !ENABLE_UI 2023-03-23 14:48:30 -03:00
David Capello
78de8dfa56 [lua] Add app.theme:styleMetrics() function 2023-03-23 14:11:51 -03:00
David Capello
0c092cc37c Fix changing playback speed shouldn't stop the animation playback
Regression introduced in 30a88c8e3d
2023-03-22 18:39:29 -03:00
David Capello
1f7f3677f2 Play subtags + repeat field by default to avoid surprises
If we start playing from a tag with a repeat field, we'll just play
the tag as many times it says and continue with the regular animation
of the sprite. Users expect the repeat field to be useful with the
default configuration of the program.
2023-03-22 15:14:41 -03:00
David Capello
63a387d804 Fix crash right-clicking play button in the preview window is hidden
Regression introduced in 30a88c8e3d
2023-03-22 15:05:29 -03:00
David Capello
e865374805 Fix bug saving tags in file sequences using -save-as "{tag}_1.png"
Now the equivalent was "{tag}_{frame1}.png", but it looks like a
regression reported here https://community.aseprite.org/t/17253 were
it was possible to just specify the frame number as in "{tag}_1.png"
2023-03-22 14:35:52 -03:00
David Capello
30a88c8e3d Put playback options into Frame > Playback submenu
This menu was accessible right-clicking the Play button in the
Timeline (and in the Preview window, with specific options for the
Preview).

This change includes some changes:

1. Now if a menu <item> in gui.xml doesn't specify a text field, the
   text of the command is used (to avoid double translation, the bad
   side is that we don't have a mnemonic specified).
2. Menu::showPopup() can be used with submenus from the root menu, to
   do this we have to remove the menu item owner temporarily before we
   show the menu as popup (see the change in Menu::showPopup())
3. We can specify a special active DocView for commands with
   UIContext::SetTargetView, this is used to set the Preview editor as
   active view for commands like TogglePlayOnce, etc.
2023-03-21 17:18:05 -03:00
David Capello
0dbcdc8159 [lua] Add app.uiScale property 2023-03-20 18:26:44 -03:00
David Capello
d2fc1ae7b8 [lua] Add Plugin:newMenuSeparator() function 2023-03-20 18:25:21 -03:00
David Capello
f6df07ada6 [lua] Change GraphicsContext.opacity to an integer value from 0..255
To match the opacity of Layer and Cel.
2023-03-20 15:51:30 -03:00
David Capello
de307ba6b0 Minor changes in FileOp::createSaveDocumentOperation() 2023-03-20 12:55:43 -03:00
Gaspar Capello
18c56ae638 Add frame duration warnings saving animated GIF files (fix #1504) 2023-03-20 12:55:34 -03:00
David Capello
63de8edfdf Minor changes in file_format_doesnt_support_error/warning strings 2023-03-20 12:55:20 -03:00
David Capello
298981732e Don't change grid settings from Preferences if they aren't modified (fix #3479) 2023-03-16 18:08:40 -03:00
Martín Capello
7b63651775 Fix rotation inaccuracy (fix #3041) 2023-03-16 17:48:26 -03:00
David Capello
1d3be8c2fa Merge branch 'fix-onion-skin-loop-tag' 2023-03-16 17:47:12 -03:00
David Capello
17687d4012 Moving through the Undo History states must behave as we are redoing/undoing changes in the sprite
This "undoing" state (introduced in b43f2a3428)
is used in the scripting AppEvents (a ContextObserver) onActiveSiteChange()
impl to trigger a 'sitechange' event for scripts/plugins so they know
if the change was from a undo or from the regular user interaction
(some scripts will add more actions to the transaction if the change
is from the user, not from a undo/redo, or now with this fix,
navigating the history)

This was a source of crashes for the Attachment System when using the
Undo History (e.g. https://github.com/aseprite/Attachment-System/issues/83
+ using the Undo History window)
2023-03-16 17:10:17 -03:00
David Capello
b7770f5fac [lua] Add KeyEvent.repeatCount (fix aseprite/api#95)
As "repeat" is a keyword on Lua, it makes things complicated.
2023-03-16 14:55:30 -03:00
David Capello
87251e52be Fix assert() when reading a LayerTilemap() from undo where a nullptr tileset is set temporarily 2023-03-16 10:44:55 -03:00
Martín Capello
6a827890ab Fix to make TwoLoopsInCascadeReverse test work 2023-03-15 17:56:07 -03:00
Martín Capello
b1335c2c00 Fix onion skin rendering (fix #3739) 2023-03-15 17:56:07 -03:00
Martín Capello
6702844314 Minor code simplifications 2023-03-15 17:56:07 -03:00
David Capello
eb82bd6ce5 Set display parent of menu boxes correctly (fix #3754) 2023-03-15 16:37:28 -03:00
David Capello
5831cda066 Fix std::clamp() assert fail in ui::fit_bounds() 2023-03-15 16:32:56 -03:00
Martín Capello
e6cd13d7e1 Allow recovering of sessions generated in previous Aseprite versions (fix #3727) 2023-03-14 19:10:11 -03:00
David Capello
e79907dae3 Add missing src/app/script/blend_mode.h file for 17c66181ae 2023-03-13 21:40:20 -03:00
David Capello
17c66181ae [lua] Replace Paint() class with GraphicsContext.blendMode/opacity properties
In some way we prefer to simplify the GraphicsContext class instead of
exposing a new Paint() class (which might be confusing with the
app.useTool() too).

Now BlendMode can be used for GraphicsContext.blendMode and
Layer.blendMode (not all modes are available in both cases).

This reverts commit 3d7c05c8f1.
2023-03-13 21:19:23 -03:00
David Capello
3d7c05c8f1 [lua] Add Paint class and argument to GraphicsContext::drawImage(img, srcRc, dstRc, paint) function 2023-03-13 18:18:44 -03:00
David Capello
87cd81b9f6 [lua] Cache temporal surface in GraphicsContext::drawImage() 2023-03-13 17:10:25 -03:00
David Capello
c280732fb1 [lua] Use SrcOver blend mode for GraphicsContext::drawImage() 2023-03-13 17:10:09 -03:00
David Capello
e4d3e7d4cf Add info about installed extensions w/Sentry breadcrumbs (#3729) 2023-03-13 16:12:03 -03:00
David Capello
88296340a6 [lua] Add Size:union() function 2023-03-13 16:03:03 -03:00
David Capello
3280b87a53 Minor change: replace macro with inline function
Always prefer functions or template functions instead of macros.
2023-03-13 11:11:05 -03:00
Martín Capello
b0967e2aa5 Copy light theme latest changes into dark theme 2023-03-13 10:52:01 -03:00
Martín Capello
b72d498070 Introduce a "combobox" style to replace the way combobox entries are painted 2023-03-13 10:52:01 -03:00
Martín Capello
7a338250a3 Fix alignment of several controls when UI scaling is 200% and Screen scaling is 100% to make them look the same as when US scaling is 100% and Screen scaling is 200% 2023-03-13 10:52:01 -03:00
David Capello
af043a0c9f Update clip module 2023-03-13 10:50:58 -03:00
David Capello
23557a190b [lua] Add Plugin:newMenuGroup() to add submenus (fix #3731) 2023-03-09 16:41:37 -03:00
David Capello
b43f2a3428 Fix order of cmds added when a new layer is created (fix #3736)
As creating a new layer was generating a onActiveSiteChange() event,
if a script was listening that event and adding new
actions (e.g. changing the layer properties), the order of cmds was
incorrectly created (e.g. cmd::SetUserDataProperty for the layer, and
then the cmd::AddLayer).

With this change we first add the cmd::AddLayer and then any extra
cmd::SetUserDataProperty (or any other action) that can be added in
the sitechange event.

We've created ev.fromUndo flag to the app 'sitechange' Lua event so
scripts can detect if we are undoing/redoing in a site change event,
and avoid adding new properties/actions when this happens.

And we have added a new exception (CannotModifyWhenUndoingException)
to detect if a new action/cmd is added (incorrectly) when we are
undoing/redoing.

Related to #3720
2023-03-07 20:41:15 -03:00
Martín Capello
b34a50a87e Fix regression pasting images outside the canvas limits (fix #3725) 2023-03-07 17:44:18 -03:00
Martín Capello
ff14066d1f Use coordinates of type double to calculate grid lines positions 2023-03-07 17:18:11 -03:00
David Capello
232131122e Fix crash/assert painting a RecentFileItem (or any ui::Widget) without parents (fix #3504)
We were finally able to reproduce #3504 (an assert fail) and it looks
like a bug in the Widget::removeChild() function, where kPaintMessage
messages weren't removed from the queue after the widget is removed
from its parent.
2023-03-04 12:07:28 -03:00
Gaspar Capello
31ca1b6350 Removed alpha threshold in octree map algorithm (fix #3715) 2023-03-03 15:44:14 -03:00
David Capello
5d543fe463 Don't notify about the CPU architecture in the Sentry release version
So we can group all crash reports by version number (the architecture
is informed by Sentry).
2023-03-03 15:07:12 -03:00
David Capello
355ceacff4 Merge branch 'buttonset-issues' (fix #3554, merge #3565) 2023-02-28 15:08:54 -03:00