Commit Graph

9167 Commits

Author SHA1 Message Date
Gaspar Capello
572cdf2b0e Add check box "Same in all tools" in the Dynamics options window (fix #4003)
Now each tool has independent 'dynamic options'. A global configuration
for all tools is also possible via the 'Same in all tools' option.

ALso this fix, solves a regression inserted in:
2cc15cda9e
(bug inserted: stabilizer is always active)
2023-08-18 15:35:15 -03:00
David Capello
bee6b98336 Add support for dark mode title bars on Windows 11 (fix #3527) 2023-08-16 17:48:45 -03:00
Martín Capello
115e20d2a5 Add tab widget to lua api 2023-08-14 18:08:33 -03:00
Gaspar Capello
456113d015 Fix after dropping a selection via Copy (Selection + Ctrl), handlers are not positioned correctly (fix #3977)
This fix disables the fine control when the transformation doesn't
include rotation, skew and/or fine scaling (so just translating doesn't
allow fine control until we rotate/skew/scaling, this might change in
the future if we add a new anti-aliasing rotation algorithm).
Also this fix improves the regular movement of the selected image.
2023-08-14 18:08:20 -03:00
Gaspar Capello
2cc15cda9e Add save dynamics options between sessions (fix #3933) 2023-08-14 18:07:46 -03:00
David Capello
9755efece4 Add note to remove duplicated code incorporated in aebb370906 2023-08-14 18:06:55 -03:00
Martín Capello
aebb370906 Add autoscrollbars feature to Lua API Dialog:show function 2023-08-14 18:04:24 -03:00
Martín Capello
1143e3bb4f Limit window position to prevent hiding its title bar when using single-window UI (fix #3839) 2023-08-14 18:04:24 -03:00
David Capello
7358626859 Add flip/rotate brush support to ChangeBrush command (#1222)
Implement part of:
https://github.com/aseprite/aseprite/issues/1222
https://steamcommunity.com/app/431730/discussions/1/1479856439033920884/
https://community.aseprite.org/t/flipping-rotating-the-current-brush/1854
2023-08-09 21:56:55 -03:00
David Capello
2406e2b197 Add FlipDiagonal algorithm 2023-08-09 16:12:02 -03:00
David Capello
aeeef8e255 Add suppor for doc::Image row stride size > width size
This patch solves several problems introducing the possibility to
specify a row stride bigger than the width (visible pixels) on each
image row. Useful in case that we want to align the initial pixel
address of each row (if DOC_USE_ALIGNED_PIXELS is defined).

This allows us to use some SIMD intrinsics (e.g. SSE2) for some image
functions in the future (right now implemented only in the new
is_same_image_simd_templ() for is_same_image()).

Anyway to avoid breaking some existing code, by default we'll still
keep the old behavior: row stride bytes = width bytes (so
DOC_USE_ALIGNED_PIXELS is undefined).
2023-08-07 15:27:39 -03:00
David Capello
ce37fbc8e3 Minor fix in doc_range_tests in the internal image used 2023-08-04 14:45:31 -03:00
David Capello
558ff54cb0 [lua] Add traceback info when a doc object is deleted and we try to use it
A reference to a doc object (Sprite, Layer, Cel, etc.) is done through
its ID in the scripting engine, when we try to access it from a script
that element might be already deleted. Previously we displayed the a
message like "Using a nil 'Cel' object". With this change we show the
traceback and a "Tried to access a deleted 'Cel'" message.
2023-08-03 20:45:44 -03:00
David Capello
741cd31fdd Update laf module 2023-08-03 13:51:40 -03:00
David Capello
50dbba268d Update actions to use new node16 as GitHub is deprecating node12 2023-08-02 18:46:52 -03:00
David Capello
413288a014 Improve flip_image() performance (x10 from old impl, x2 from new slow impl)
The old impl was using get/put_pixel(), the new slow one is using the
get/put_pixel_fast(), and the new default flip_image() is using just
raw pointers.

Added some utilites like random_image() for testing purposes, and
DOC_DISPATCH_BY_COLOR_MODE() macros to avoid switch/case for each
color mode. In a future these might use generic lambdas.
2023-08-02 17:35:20 -03:00
David Capello
2e1d50bf33 Fix some std::clamp() calls: max value cannot be less than min value 2023-07-31 10:31:08 -03:00
Gaspar Capello
ab2d7f79a3 Fix Magic Wand should "refer to visible layers" anyway when the active layer is hidden (fix #3939) 2023-07-25 10:27:06 -03:00
Gaspar Capello
a2e3ab44bd Don't rotate rectangular selection when we're in "subtract mode" and touch editor edges (fix #3976)
As Shift+Alt enables the subtract mode, if we touch an editor edges
and receive a MouseEnter message, we cannot update the selection
modifiers with the pressed Alt key because that will start rotating the
rectangular marquee automatically. We've to start rotating only if we
release the Alt key and then press it again (not by just moving the
mouse).

Recent regression introduced in bd91a6430f
when the ordering of MouseEnter/Move/Leave message order was fixed.
2023-07-25 10:18:46 -03:00
David Capello
392dbd1303 Fix font issues w/some Cyrillic script chars (fix #3797, fix #3975)
* Fixed spacing of "в", "о", and "л".
* Fixed "У", "у", "х" glyphs.
2023-07-24 17:43:55 -03:00
David Capello
056073b3f1 Fix regression w/initial folder on file selector (fix #3979)
Regression introduced in 556c621eeb
2023-07-24 16:19:59 -03:00
David Capello
400456cbec Right-clicking a tileset mode button gives the possibility to set it as the default one
Feature request: https://community.aseprite.org/t/19487
2023-07-19 11:27:00 -03:00
David Capello
11644a7d16 Add Shift+F7 to toggle other layers visibility on Preview window 2023-07-19 10:56:16 -03:00
David Capello
32009723c5 [lua] Ask for access for package.loadlib() function 2023-07-19 09:15:15 -03:00
David Capello
64369281fa Update laf module 2023-07-18 21:48:44 -03:00
David Capello
890ed91d81 [x11] Disable the native file selector on X11 (#3974)
It looks like the mouse got captured by the Aseprite window if we
start the Zenity command using the mouse in certain way (e.g. when we
click the Open File link from the Home tab). The same doesn't happen
if we press Ctrl+O or click the File > Open menu.
2023-07-18 21:42:49 -03:00
Gaspar Capello
e9f078e66e Fix error decoding pico-8 GIFs (fix #3922) 2023-07-18 20:55:32 -03:00
Martín Capello
242555ab06 Allow changing the tileset assigned to a tilemap layer 2023-07-18 18:50:57 -03:00
Martín Capello
4926f4c1fc Show, duplicate and delete tilesets in Sprite Properties dialog (fix #3875) 2023-07-18 18:50:57 -03:00
David Capello
a2d8a080f5 [lua] Create app.window to access new main window properties (#3927)
We moved the app.width/heigth to app.window.width/height and
app.events.on('resize', ...) to app.window.events.on('resize', ...).
2023-07-18 17:54:57 -03:00
lampysprites
7ee866643b [lua] Add width and height properties to app 2023-07-18 15:50:22 -03:00
lampysprites
30b858d89e [lua] Add "resize" to app events 2023-07-18 15:50:19 -03:00
Gaspar Capello
98366d3dee Fix layer name cell resizing in timeline during gui scaling or theme change. 2023-07-18 15:39:59 -03:00
Gaspar Capello
264cd98ab4 Fix menu items that don't respect UI scale (fix #3843) 2023-07-18 15:39:59 -03:00
Gaspar Capello
081f1e535b Fix ButtonSet widget with icons resizing when UIScale is changed 2023-07-18 15:39:59 -03:00
Gaspar Capello
0c3d78b4ce Fix unexpected behavior during multiple cel selection + cel property changes (fix aseprite/aseprite#3886)
Prior to this fix, if a field was modified, all fields were overwritten with the values from the Cel Properties dialog.
2023-07-18 10:39:13 -03:00
David Capello
daf3e70e9d Fix warning about undefined blend mode conversions
This was added to avoid the "control reaches end of non-void function"
warning.
2023-07-17 19:29:07 -03:00
David Capello
e84bee0f99 Minor changes removing "using namespace doc" from app/color.h 2023-07-17 15:02:15 -03:00
David Capello
86a50e2e9a [lua] Add native API to decode/encode JSON text (fix #3233)
New json.decode(jsonText) and json.encode(luaTable) functions.

In this way we don't depend on third-party libraries to decode/encode
JSON text which is a quite common task (in tests and export scripts).
2023-07-17 09:25:13 -03:00
David Capello
00b75a76a8 Add displayName property for language extensions (fix #3964)
The default language (en.ini) has a new "display_name" property, but
probably we should remove it and transform the English language in an
extension (just as the default Aseprite theme).
2023-07-12 12:25:30 -03:00
David Capello
35e64ad2f3 Fix exporting selection to gif/fli/webp files (fix #3827) 2023-07-11 13:33:45 -03:00
David Capello
bd91a6430f Process os::Event::MouseEnter/Leave in correct order
When we received a MouseEnter/Leave, we were processing those laf-os
events immediately without taking care of all the MouseMove/Down/Up
events in the middle. Now we enqueue all the events as
messages (MouseEnter -> MouseMove/Down/Up -> MouseLeave).

This is important because when we process MouseLeave we are calling
setMouse(nullptr), which resets the mouse widget HAS_MOUSE flag, and
some widgets needs to know if they have the mouse above before the
MouseUp event. With this change we can remove the
Widget::hasMouseOver() function (that was checking the global
ui::get_mouse_position() instead of the HAS_MOUSE flag directly).

Another change was introduced to keep the old behavior now that
hasMouseOver() is not available: the ui::Manager doesn't assign the
HAS_MOUSE flag if the mouse is captured (it only assign the HAS_MOUSE
to the widget with the mouse captured, or to no widget, at least until
the capture is released).
2023-07-10 10:54:37 -03:00
David Capello
48275d51c2 [lua] Add new AfterAddTile event for tile management plugins
Replaced the App BeforePaintEmptyTilemap event (introduced in
c26351712a) with the new Sprite
AfterAddTile event triggered by draw_image_into_new_tilemap_cel().
This new event handles two cases:

1) When the user paints on an empty tilemap cel, a new tile is
   created, so the tile management plugin can handle AfterAddTile
   to know the existence of this new tile.  (This case was disabled
   with fae3c6566c, then handled with
   c26351712a, now handled with this
   patch).

2) When we copy & paste cels (or drag & drop cels) in the timeline
   between layers, if a new tile is created, the AfterAddTile is
   called and the plugin can associate tiles with its internal
   information (e.g. folders)

Related to: https://github.com/aseprite/Attachment-System/issues/135
2023-07-07 18:40:06 -03:00
Martín Capello
9db01bf82f Fix crash accessing theme dimensions/info in a plugin's init() function (fix #3913) 2023-07-06 18:21:36 -03:00
Martín Capello
b0b2fb378e Fix direction reset after scrolling the editor while playing an animation with "ping-pong" direction (fix #3903) 2023-07-06 17:54:06 -03:00
Gaspar Capello
f7bc918926 Fix crash when loading an extension with invalid dithering matrices (fix #3914)
Before this fix, when installing dithering matrices if Aseprite
couldn't find the file of some matrix described in the json, Aseprite
would crash (this happened during the installation of an erroneous
dithering matrices extension, and after every reboot of Aseprite).

The cause of the crash was the absence of the MainWindow instance
during the ContextBar creation. When an error occurs, the console is
called, but since MainWindows is not yet available, aseprite crashes.
2023-07-06 11:07:39 -03:00
TakWolf
3134bfaa30 Remove duplicate string in en.ini and extra whitespace 2023-07-06 10:59:04 -03:00
David Capello
c527d68c64 Fix Assign/Convert button labels in Sprite Properties dialog
Regression introduced in 974c13dd33
2023-07-06 10:36:41 -03:00
Zephyr Lykos
2f6655f57e Fix compilation on GCC13
See: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
Bug: https://bugs.gentoo.org/865117
Bug: https://bugs.gentoo.org/895616

Signed-off-by: Zephyr Lykos <self@mochaa.ws>
2023-06-29 14:19:43 -03:00
Martín Capello
204ee881be Prevent executing the logic for showing an alert when removing all sprite's layers and the UI is unavailable 2023-06-27 15:26:11 -03:00