Commit Graph

6557 Commits

Author SHA1 Message Date
David Capello
70e2abaf69 Fix some issues detected with the ThreadSanitizer 2021-04-13 15:35:34 -03:00
David Capello
8b4746e813 Add option to disable the "open sequence of files" dialog 2021-04-12 16:57:02 -03:00
David Capello
5e98b39944 Expand timeline range outline for layers/frames to all cels 2021-04-12 14:48:16 -03:00
David Capello
1b0466af17 Fix some bugs drawing the timeline when we scroll it
Mainly the range outline outside the frames header.
2021-04-12 14:47:59 -03:00
David Capello
8d6f889e0e Add option to keep the timeline selection when we draw on the canvas 2021-04-12 14:47:47 -03:00
David Capello
2df3cd8a80 [lua] Add app.command.ImportSpriteSheet()
Feature request: https://community.aseprite.org/t/8482
2021-04-09 17:28:59 -03:00
David Capello
3769d91125 [lua] Add Sprite.pixelRatio property
Feature request: https://community.aseprite.org/t/8627
2021-04-09 16:22:50 -03:00
David Capello
5053443d21 Load indexed tga w/transparent pal entries as transparent layer
Before this we were loading the file with a Background layer with a
transparent palette entry.
2021-04-09 12:09:45 -03:00
David Capello
cff3475941 Don't show warning when saving indexed tga w/transparent pal entries 2021-04-09 12:09:09 -03:00
David Capello
f311e3edde Fix selection feedback in indexed when mask color w/alpha=0 (fix #1412, fix #1667)
Also reported recently here (and probably in several other places):
https://community.aseprite.org/t/8462
2021-04-09 11:11:41 -03:00
David Capello
64f96f0851 [linux] Use $XDG_CONFIG_HOME if defined instead of $HOME/.config (fix #2332) 2021-04-08 15:56:32 -03:00
David Capello
f1b02a3347 Deselect timeline range in "auto select layer" mode if we just click the active layer
Fix: https://community.aseprite.org/t/8610
2021-04-08 15:21:11 -03:00
David Capello
f91c07825b Don't use Timeline range if it's hidden in editor site & moving cel 2021-04-08 15:17:39 -03:00
David Capello
f3ab779bfd Don't transform hidden layers (fix #2680) 2021-04-08 11:24:55 -03:00
David Capello
565057cf77 Add missing file in 67eeac8045 2021-04-07 18:51:48 -03:00
David Capello
9c319e46ac Fix bug transforming the same linked cel two times
As we wanted the current cel as the first cel to transform (to avoid
re-transforming it with inner cmds when we drop pixels), if this cel
was a linked from other one it will not be removed from the
getEditableCels() list, so two linked cels would appear two times in
the list. Now we remove the current cel correctly when it's a linked
cel after re-adding it.

Reported here: https://community.aseprite.org/t/8618
2021-04-07 18:32:56 -03:00
David Capello
67eeac8045 Fix bug keeping the modified range different than the visible range when moving pixels
When we clicked the current cel/frame/layer on MovingPixelsState in
the Timeline, we weren't dropping the pixels, so the range was
different in the Timeline UI, but we were using the old site range
which was different (bigger) than the Timeline range.

Fixes several bugs: https://community.aseprite.org/t/8618
2021-04-07 18:11:30 -03:00
David Capello
169cfa39cf Use timeline selection only when it's visible 2021-04-07 15:20:36 -03:00
David Capello
a122f1ceba Reset tool preferences just once when running from CLI 2021-04-07 12:58:03 -03:00
David Capello
351900b4e7 Update flic and tga modules 2021-04-07 11:24:39 -03:00
David Capello
a5c36d0b0f Add possibility to cancel the DrawingState with Undo/Redo/Cancel commands
To match the new MovingCelState behavior.
2021-03-26 12:05:28 -03:00
David Capello
768b69113a Disconnect from BeforeCommandExecution signal onBeforePopState to avoid double backToPreviousState() calls
In some special cases (several key press enqueued?) we can receive a
BeforeCommandExecution signal when we are not part of the Editor state
stack anymore.

Related to 5ba8cecdde
2021-03-26 11:40:10 -03:00
David Capello
5ba8cecdde Fix a crash pressing (and keeping pressed) Ctrl+Z (Command+Z)
This tries to avoid calling onBeforeCommandExecution() after we are
going to the previous state. This might be a problem on all states
that are using a scoped_connection to disconnect from the app::Context
signal in the destructor (instead of in the
onBeforePopState). Something to fix next for all other states.
2021-03-26 10:45:46 -03:00
Gaspar Capello
42201a4783 Fix bug while moving an image in MovingCelState
Original post: https://community.aseprite.org/t/pretty-nasty-bug-specific/8290

Before this fix, if you pressed Cmd Z / Ctrl Z (undo) while moving an image holding Cmd/Ctrl key,
the moved image were gettting stuck on cursor, and console errors were shown on every click.
2021-03-26 10:01:11 -03:00
David Capello
a9640a28dc Fix several bugs handling the clipboard on X11 2021-03-22 11:27:59 -03:00
David Capello
6b89075b26 Don't send paint messages when we are closing the app 2021-03-09 16:43:22 -03:00
Gaspar Capello
1193bf18fc Fix lua error crash (fix #2635)
Prevents crashes from uncaught exceptions generated from Lua errors
when running aseprite from the console with -script param.
2021-03-09 16:40:24 -03:00
David Capello
2dccb6d646 Add GitHub actions 2021-03-08 11:38:04 -03:00
David Capello
35bb3af6e2 Replace all base::Bind() with lambda functions 2021-03-05 20:09:42 -03:00
David Capello
ddbbf12bfc Update main branch 2021-03-05 18:39:36 -03:00
David Capello
ef4f691459 Generate a native cursor for the crosshair on the sprite
In this way we can get pixel from the window surface and put pixels in
the new cursor surface which will represent the crosshair on the
mouse/screen position. In this way we avoid an effect of a slow mouse
response on high refresh rates.

Maybe related to: https://community.aseprite.org/t/3354
2021-02-25 16:56:33 -03:00
David Capello
a24f271e3a Remove unused vars from BrushPreview 2021-02-25 14:44:07 -03:00
David Capello
74ee4dced4 Fix DEBUG_PAINT_EVENTS on Windows 2021-02-25 13:14:39 -03:00
Gaspar Capello
3035a5713d Fix crash deleting a group layer at the top level
The crash could be achieved by having just one group layer at the top
level (with some children) and trying to delete it using Layer >
Delete Layer menu option (without using the timeline range).

Report: https://igarastudio.zendesk.com/agent/tickets/1719
2021-01-15 17:02:10 -03:00
David Capello
32106512dc Update about/status bar copyright info 2021-01-15 14:46:45 -03:00
David Capello
b1b201a22c Minor change in ui::Widget to check current manager 2021-01-15 13:16:40 -03:00
Gaspar Capello
980454eac0 Fix brush symmetry
Prior to this fix, asymmetric brushes weren't reflected, instead the brush was simply moved to a mirrored position.
2021-01-15 12:15:16 -03:00
David Capello
2be11cf2f5 Fix ASSERT deleting a backup session on start when there is no UI
This can happen if the session folder cannto be deleted e.g. when the
folder is not empty (for example if we've copied/created a file in the
session folder manually).
2021-01-15 11:43:07 -03:00
David Capello
ee07df6a26 CSS output without vars by default 2021-01-05 15:02:12 -03:00
David Capello
b1016a419f Minor formatting changes 2021-01-05 14:43:43 -03:00
David Capello
e813773445 Merge branch 'feature-css-export' into css-export 2021-01-05 12:23:57 -03:00
David Capello
d4072fac94 Merge branch 'save-palette-as-preset' 2021-01-05 11:48:57 -03:00
David Capello
d3f3858859 Minor change "save_as_preset" -> "saveAsPreset"
This new camelCase style is prefered since the introduction of the Lua
scripting API.
2021-01-05 11:41:26 -03:00
David Capello
de22d69678 Add FinishLoading signal to ResourcesListBox to detect when the resources were loaded
In this way we avoid using ui::ListBox::Change signal as a
workaround (which is a signal that should be fired only from
ui::ListBox::onChange()).
2021-01-05 11:03:29 -03:00
mezz
3211831da3
Create and use new signal: PalettePresetsChange 2021-01-04 09:53:20 -10:00
David Capello
4b1e4c67c5 Merge branch 'fix-2564' 2021-01-04 15:55:50 -03:00
David Capello
23559a9b44 Don't generate new slice keyframes when duplicating the sprite (duplicate only the slice keyframes)
Related to #2568
2021-01-04 15:52:56 -03:00
Gaspar Capello
a7419c7813 Fix pen pressure size + symmetry
This fix improves the symmetry drawing when symmetry and the pen pressure size are on.
2020-12-30 16:35:36 -03:00
mezz
be48c40dc5
Reload palette popup and refresh search results when saving a new preset 2020-12-29 20:45:37 -10:00
mezz
98a0bcb2d7
Add palette option to save as preset
This works the same as saving a palette normally, but opens the file dialogue to the default palette preset directory.
2020-12-29 19:56:02 -10:00
David Capello
21e893162d Add possibility to hold tool modifiers when we start drawing on kMouseDownMessage (fix #2537)
E.g. In this way we can press the Shift modifier, then press the mouse
button to start drawing successive straight lines with the angle
snapped (so there is no need to release/press the Shift modifier again
and again).
2020-12-14 14:49:16 -03:00
David Capello
81d9e8afec Fix bug with Console when the UI Screen Scaling is changed 2020-12-11 15:52:14 -03:00
David Capello
c0ac9208ff Fix layer name for new sprites to match the translation in new layer (fix #2549) 2020-11-27 19:27:13 -03:00
David Capello
85e51abcaa Minor changes about old "layer set" -> "layer group" 2020-11-27 19:26:18 -03:00
sumibi-yakitori
25ca9e4a13 Add duplicate slices 2020-11-23 16:41:14 +09:00
David Capello
ca013ff5d8 [lua] Check that some arguments are really strings in make/removeDir 2020-10-22 12:17:49 -03:00
David Capello
14893fbaf8 [lua] Add functions to make/remove directories with app.fs 2020-10-22 11:36:52 -03:00
David Capello
661f4897b2 Check that we're in the UI thread when modifying the widgets collection 2020-10-20 12:54:56 -03:00
David Capello
38d1b8a8e2 Fix Flip command labels when assigning shortcuts (fix #2545) 2020-10-17 09:36:36 -03:00
David Capello
6c4621a26a Fix copy & paste of images from GM2 2020-10-13 10:49:26 -03:00
David Capello
f44aad06db [lua] Fix Dialog:file{ save=true } so 'save' field must be =true
Before this change if we used Dialog:file{ save=false } it would show
the save version of the dialog, which didn't make sense.
2020-08-18 08:55:04 -03:00
David Capello
95ce7541e7 Avoid redrawing transformation on each mouse position change (related to #2149) 2020-08-17 17:35:34 -03:00
David Capello
b355f34a70 Export all groups (even collapsed ones) by default in JSON metadata (fix #2484) 2020-08-17 17:14:12 -03:00
David Capello
f3e9978bb0 [win] Fix pasting 32-bpp images from Firefox
And any app that use DIBV5 format with BI_RGB compression.
2020-08-13 11:02:01 -03:00
David Capello
955d0a9c41 [win] Minor change to call CoInitialize()/CoUninitialize() 2020-08-12 11:16:31 -03:00
David Capello
6987a15986 Update submodules 2020-08-12 11:16:16 -03:00
David Capello
282b040b52 [win] Fix copy & paste 32bpp images w/alpha channel from/to some Windows programs
More information:
https://steamcommunity.com/app/431730/discussions/0/1846946102842809327/
2020-08-11 19:30:39 -03:00
Gaspar Capello
d701ef9ffd Fix replace current pallete does not create a palette (fix #2480) 2020-08-11 10:19:37 -03:00
David Capello
ddee4dc0b9 Fix start playing animation on preview window when adding/removing frames (fix #2481) 2020-08-11 08:45:30 -03:00
David Capello
bbfa023b30 Fix crash adding new frames when there are tags present 2020-08-04 22:39:54 -03:00
David Capello
d93264c895 Fix opening files from CLI with new OpenBatchOfFiles utility 2020-08-04 18:22:37 -03:00
David Capello
14fbee19f0 Fix cli_tests when Strings is not available 2020-08-04 18:11:18 -03:00
David Capello
893c8cbe32 Fix minor issues redrawing auto cel guides on Editor
E.g. We could open a (foreground) dialog (e.g. New File), and move the
window, and press the Ctrl key to show the auto-guides (or released it
to hide the auto-guides) for new painted areas of the Editor. This
patch fixes that bug.
2020-08-04 16:29:22 -03:00
David Capello
6862bb8ab0 Fix opening several times the "save changes" alert (fix #2467)
This could happen if we clicked the cross icon in tabs without moving
the mouse.
2020-08-04 15:09:33 -03:00
David Capello
819517b941 Fix reported crash in MovingPixelsState::onUpdateStatusBar()
This should be enough to fix a crash reported where we receive a
onUpdateStatusBar() when m_pixelsMovement is already deleted. It's
called from onLeaveState() when we call notifyGeneralUpdate() which
generates a scroll change and finally updates the status bar.

Crash report: https://igarastudio.zendesk.com/agent/tickets/1239
2020-08-04 11:12:57 -03:00
David Capello
d7a3da9518 Fix crash using opacity slider on CelProperties after deleting a cel
Crash report: https://igarastudio.zendesk.com/agent/tickets/1208
2020-08-04 10:42:28 -03:00
David Capello
430b493e89 Don't show brush edges in BrushPreview::FULLALL when we're in DrawingState
Fixes issue from 8b6116911d
2020-08-03 20:13:34 -03:00
David Capello
49c4534a95 Fix isometric lines when snap angle + from center modifiers are used 2020-08-03 20:09:56 -03:00
David Capello
b95f96f645 Don't use fixes for line brush when the brush size = 1 2020-08-03 20:07:25 -03:00
David Capello
7355d0e2db Add minor checks of .ase header 2020-08-03 17:33:15 -03:00
David Capello
1470108fff Add support to load sprites without extension (identified only by their content) 2020-08-03 17:32:13 -03:00
David Capello
cd21d33fe7 Add missing #includes 2020-08-03 17:19:23 -03:00
David Capello
d97565e4e0 [lua] Fix app.command.SetInkType{ type=... }
Related to https://community.aseprite.org/t/6532/3
2020-08-03 13:52:41 -03:00
David Capello
5edf30687b Add File > Scripts > Rescan option to rescan the available scripts
https://community.aseprite.org/t/6170/6
2020-08-03 13:51:40 -03:00
David Capello
8b6116911d Add extra options to show brush preview with Eraser/Blur/etc. tools
Feature request: https://community.aseprite.org/t/6427
2020-08-03 12:12:52 -03:00
David Capello
8c0f81cbba Improve handling of image sequences when dropping files or opening multiple files
Now we can repeat the same action (Agree/Skip the all sequence of
images) for all the dropped files/selected files in the "Open File"
dialog (as in the CLI new behavior).
2020-07-30 16:27:23 -03:00
David Capello
1255b17738 Fix opening image sequences more times from CLI
We've also fixed the Agree/Skip dialog to show a checkbox and repeat
the same action for all image sequences.

Fixes:
https://github.com/aseprite/aseprite/issues/2128
https://github.com/aseprite/aseprite/issues/1936#issuecomment-451565903
2020-07-30 14:33:27 -03:00
David Capello
4cc2c6188d Fix cycling through palette indexes when Edit Mode is on
https://community.aseprite.org/t/6500
2020-07-29 19:24:07 -03:00
David Capello
63460ef9dc Support to encode 1bpp .bmp indexed images
Simplified a little the code merged in #2473

Related issues:
https://github.com/aseprite/aseprite/issues/210
https://github.com/aseprite/aseprite/issues/2472
https://community.aseprite.org/t/3892
2020-07-29 13:46:26 -03:00
David Capello
e9ba49bb9a Fix crash saving grayscale bmps 2020-07-29 11:14:30 -03:00
David Capello
35e7483ed5 Minor change BmpFormat::onSave()
Use "w" and "h" instead of "image->width()/height()"
2020-07-29 11:13:44 -03:00
MacSpain
2d5b080b1f Added saving 4-bit images 2020-07-29 10:07:35 -03:00
David Capello
0f328e1599 Change the number of colors when loading a .bmp file 2020-07-28 18:16:07 -03:00
David Capello
7a534b0a4e [lua] Add Sprite{ fromFile="...", oneFrame=true } to load just one frame 2020-07-28 17:41:01 -03:00
David Capello
11324c207d [lua] Minor changes 2020-07-28 17:40:43 -03:00
David Capello
c4ed8c1450 [lua] We cannot detect existent keys with nil in a table (they aren't added to the table)
All non-existent keys return nil (and nil keys are not added when the
table is created, so we cannot even iterate the table to search for
keys like "always" or "sRGB"). The only solution is assigning a
non-nil value, e.g. { always=true }, { sRGB=true }, etc.
2020-07-28 17:40:19 -03:00
David Capello
c6b42173cd Add some checks to BmpFormat::onLoad() to avoid crashing on some invalid .bmp files 2020-07-28 11:36:16 -03:00
David Capello
7656627605 [lua] Fix calling onclose Dialog event when we close the app (fix https://github.com/aseprite/api/issues/28) 2020-07-28 10:35:38 -03:00
David Capello
2a48c688e2 Fix playback of same tag when adding new frames (fix https://community.aseprite.org/t/6486) 2020-07-27 18:17:48 -03:00
David Capello
866d614737 [lua] Add "ui" and "bounds" params to CanvasSize (fix https://community.aseprite.org/t/4319) 2020-07-27 17:04:17 -03:00
David Capello
4dfed179fb [lua] Fix crash undoing Sprite:newCel() in background layers 2020-07-22 14:19:11 -03:00
David Capello
0c194adef6 Fix auto cel guides painting of right and lower sides 2020-07-21 16:56:23 -03:00
David Capello
319733d30b Fix some extra issues reported by the ThreadSanitizer 2020-06-17 18:10:26 -03:00
David Capello
6f048d10c5 lua: Fix crash using Selection:deselect() when there is no selection
Fixes https://community.aseprite.org/t/6169
2020-06-17 17:13:37 -03:00
David Capello
d75c9c443a Use LOG() with the printf-like interface (the only way to be thread safe) 2020-06-17 17:05:43 -03:00
David Capello
677b8bf204 Fix several issues found with ThreadSanitizer 2020-06-17 15:55:44 -03:00
David Capello
f0c9db7041 Don't show the notification flag on Advanced Mode 2020-06-17 12:40:11 -03:00
David Capello
89a896d627 Fix Insert Text to use the sprite transparent color in indexed mode (fix #2444) 2020-06-16 21:24:32 -03:00
David Capello
52137324b4 Limit the timeline vertical separator pos in getter instead of setter
Fixed regression introduced in 7170762f08,
we must keep the original value so resizing the window doesn't reset
the value limiting it, or other strange situations where the value is
not saved correctly, e.g.:
https://community.aseprite.org/t/6107
https://community.aseprite.org/t/6097/6
2020-06-16 14:37:24 -03:00
David Capello
ad2bd63531 Fix default path to use to save a recovered document 2020-06-16 14:36:49 -03:00
David Capello
619903a2b3 Fix compilation with g++ 2020-06-11 17:15:21 -03:00
David Capello
6290f18742 Fix Screenshot command compilation when ENABLE_STEAM is undefined 2020-06-11 16:42:54 -03:00
David Capello
d46f771820 Fix compilation of steam API wrapper with MSVC 2020-06-11 16:42:23 -03:00
David Capello
3bba9d05da Give more space to AniControls if there aren't tags to display in the Timeline 2020-06-11 15:46:07 -03:00
David Capello
7170762f08 Timeline: Limit the vertical separator min/max position (fix #2436) 2020-06-11 15:30:06 -03:00
David Capello
5a24a7c6b4 [steam] Open Steam Screenshots uploader when a screenshot is taken 2020-06-11 15:09:45 -03:00
David Capello
c8999af6d6 [steam] Avoid crash taking screenshots after Steam client is closed 2020-06-11 14:51:28 -03:00
David Capello
2f472f0760 [steam] Add possibility to take screenshots and add them to the Steam library
Requests:
https://community.aseprite.org/t/6067
https://steamcommunity.com/app/431730/discussions/0/1482109512300945388/
https://steamcommunity.com/app/431730/discussions/0/1495615865218665223/
https://steamcommunity.com/app/431730/discussions/0/1708438376933048578/
2020-06-11 14:18:13 -03:00
Gaspar Capello
064482b352 Fix movement of several layer with locked layers, results in a missed image.
Before this fix, the selected image in the active layer was missed. The sequence to reproduce this bug:
- The user moves the selected image portion with several selected layers to a new position,
- Then it locks the active layer,
- Finally, it drops the selection (click outside the selected area).
The selected image in the active layer is missed.
2020-06-10 17:27:25 -03:00
Gaspar Capello
f9a9e1a0bc Intersect selection too slow (fix #2393)
Before this fix, the Intersect selection context option were much slower than Add or Subtract.
To reproduce the old 'bug':
- Create a 1000x1000 sprite
- Make a small rectangular selection on some place
- Click on the empty area with the Magic Wand in Intersect context option.
The same action in Add or Substract is much faster.
2020-06-10 17:23:22 -03:00
David Capello
73ff0dc28c Fix exporting correct set of layers in JSON's meta.layers when -split-layers and -ignore-layer (fix #2432) 2020-06-10 12:55:26 -03:00
David Capello
36252cfc2c Include groups in JSON meta data even when they weren't exported in the sprite sheet (fix #2380) 2020-06-10 11:55:23 -03:00
David Capello
9b86d30d61 [osx] Add osx_async_view option to disable the drawsAsynchronously of the NSView layer 2020-06-10 10:57:49 -03:00
David Capello
0e47d0ec24 Minor changes in doc::ImageImpl to avoid using impl details in member functions 2020-06-10 09:58:55 -03:00
David Capello
b41f1ace30 Move function to convert doc::Image -> os::Surface to app/util 2020-06-09 19:56:25 -03:00
Gaspar Capello
9c37ea41ed Fix locked layer not completely locked (fix #2181) 2020-06-09 18:03:09 -03:00
David Capello
0ba2a8922b Fix crash handling layers of multiple docs with the timeline (fix #2397)
If we were handling several documents, and merging/flatting/deleting
layers in one of those documents, it could be a problem for the
timeline range when we switched to another doc and undo/redo (because
the DocRange might be holding a pointer to an invalid/deleted layer of
the other document).
2020-06-09 17:30:02 -03:00
David Capello
b879fc855a Fix crash undoing the copy of cels from a deleted layer
This could happen when we copied a cel from another document, then
we closed that document, and undid the cmd::CopyCel in the destination
document.
2020-06-09 15:14:56 -03:00
David Capello
d8bbbfdea3 Wrap base::RWLock interface inside Doc 2020-06-08 16:16:45 -03:00
David Capello
aa1943e609 Minor refactor using cmds directly instead of DocApi in Layer/Background from Background/Layer 2020-06-08 14:47:11 -03:00
David Capello
f008d608ce Update modules 2020-06-06 13:28:02 -03:00
David Capello
2550e28c83 Fix crash recovering sessions from v1.2.9 or older
The issue here was the missing color space was allocating an huge
std::vector() because we had an invalid color space size from
read32().
2020-06-05 11:59:11 -03:00
David Capello
ae40198106 Merge branch 'svg-rendering' 2020-06-05 11:17:44 -03:00
David Capello
1068926f7b Reformat SwapCheckerboardColorsCommand file 2020-06-04 17:00:10 -03:00
David Capello
e4b224a0bd Merge branch 'swap-bg-colors' (fix #1812) 2020-06-04 16:59:41 -03:00
David Capello
29b91aed48 Show minimum brush size when dynamics is on in BrushPreview (fix #2419)
Reports:
https://github.com/aseprite/aseprite/issues/2419
https://community.aseprite.org/t/5919
2020-06-04 16:15:57 -03:00
Dan Prince
4b0d527505
Adds crisp shape rendering for svg file format 2020-06-02 00:33:39 +01:00
David Capello
6bfdada9ac Fix Simple ink on indexed sprites when painting w/transparent index 2020-05-30 20:53:34 -03:00
David Capello
98106cb2be Revert 83b2038de1 to bring back PaintInk::Type::AlphaCompositing introduced in 1509699a46 2020-05-30 20:38:02 -03:00
David Capello
445e0abb0b [win] Add Tablet section on Edit > Preferences and restore old wintab behavior
Now on Windows it's more clear the different APIs to use (Windows
Pointer vs Wintab), the Wintab API works as before (generates mouse
events on WM_MOUSE message instead for each packet), and there is a
new Wintab mode to create events directly from packets (still a little
buggy with some tablets, but might be useful in other tablets to get
more precision for fast strokes).
2020-05-30 16:54:35 -03:00
MorganDavid
39a2045a43 Added swap checkerboard colors command 2020-05-28 23:11:26 +01:00
Gaspar Capello
b0d76d096f Fix recent files history order on home view when the file count is greater than 10 (issue #2388)
This fix is backward compatible (it preserves Recent Files history of the older Aseprite versions)
2020-05-28 15:19:14 -03:00
David Capello
0fc4989419 [lua] Fix crash when setting layer.parent to nil 2020-05-28 15:12:26 -03:00
David Capello
896387635b [lua] Fail if we give an invalid parent to layer.parent setter 2020-05-28 14:24:10 -03:00
David Capello
3a82e64c23 Fix crash caused by ActiveSiteHandler::onBeforeRemoveLayer() that don't remove deleted layers from selected layers
This affected only scripts (because UI uses the Timeline to manage the
active range which is already doing this).
2020-05-28 12:26:18 -03:00
David Capello
7a74aef1a7 [lua] Use the correct "controller" when "tool" param is specified in app.useTool()
Fix regression introduced in 1ec502d242
2020-05-28 12:01:34 -03:00
David Capello
6d2ddf877b "contiguous" option is true by default for paint bucket-like tools 2020-05-27 15:18:04 -03:00
David Capello
1b08d5248c Fix Flip command when ENABLE_UI is off 2020-05-27 14:48:16 -03:00
David Capello
9b26e422f7 Make range boundaries smaller for layers to enable alt+click on icons (fix #2222) 2020-05-26 12:02:15 -03:00
David Capello
d4b4dfd36d Fix the ink processing to draw brushes w/alpha compositing on indexed sprites 2020-05-25 17:33:29 -03:00
David Capello
83b2038de1 Remove PaintInk::Type::AlphaCompositing introduced in 1509699a46
"Simple" and "Alpha Compositing" user inks will still use the internal
"PaintInk::Type::Simple" type that is then converted to
"TransparentInkProcessing" when opacity < 255 (alpha compositing
case).
2020-05-25 12:30:53 -03:00
David Capello
f56931a612 Add missing #include in engine.cpp 2020-05-22 11:15:15 -03:00
David Capello
2bfd3261b5 Define fill_toolloop_params_from_tool_preferences() only when needed 2020-05-22 11:15:04 -03:00
David Capello
3163d00e1e Avoid multi-line comment warning 2020-05-22 11:14:48 -03:00
David Capello
60c54a3242 Fix edge case w/alpha compositing on indexed images
On indexed images, if we paint with alpha compositing and opacity=255,
we can act just like the simple ink, copying the color (the original
index). If we go through the process of color blending, we might loss
the index in sprites that contain palettes with the same color two or
more times.
2020-05-21 20:36:04 -03:00
David Capello
c6720b543a Move doc::rgba_to_graya_* functions from .h to .cpp 2020-05-21 20:07:23 -03:00
Gaspar Capello
1509699a46 Fix Alpha Compositing Ink - Indexed Mode - Pencil tool with transparent color selected.
The normal Alpha Compositing Ink behavior is:
Do nothing when the user wants to paint with the transparent color.

Before this fix, Alpha Compositing in Indexed Mode worked like Simple Ink
2020-05-20 17:16:51 -03:00
David Capello
1ec502d242 Add "ink" parameter to app.useTool() + minor needed refactors 2020-05-20 17:15:30 -03:00
David Capello
b922cfcc10 Refactor ToolLoop creation w/ToolLoopParams to add more options to app.useTool()
This will be used to add more testing capabilities to app.useTool()
2020-05-19 20:11:47 -03:00
David Capello
39f2269ea5 Don't scale the marching ants pattern 2020-05-19 09:27:24 -03:00
David Capello
3d2013b33c Draw mask boundaries with a gfx::Path
The path is also cached so on each re-paint we can re-use it while
it's still valid.
2020-05-18 17:58:22 -03:00
David Capello
a2cdde8ec8 [lua] Add "enabled" and "visible" properties when creating new widgets
Fixed https://github.com/aseprite/api/issues/29
2020-05-15 19:03:46 -03:00
David Capello
f491a2a506 Add ui::Entry::Range to simplify code 2020-05-15 18:24:35 -03:00
David Capello
fa187b35a8 Don't delete extra char using Ctrl+backspace to delete words in ui::Entry 2020-05-15 18:15:59 -03:00
David Capello
7cde901047 Alt+backspace deletes a word too on ui::Entry fields 2020-05-12 15:11:15 -03:00
David Capello
68720424c0 [lua] Dialog:modify{} now can modify the text of a separator
Fixes https://github.com/aseprite/api/issues/27
2020-05-11 12:26:43 -03:00
David Capello
d9b0887a3a Fix crashes running tests from CLI 2020-05-08 19:44:29 -03:00
David Capello
72ceaa010f Save user data changes correctly in current recovery session 2020-05-08 18:34:54 -03:00
David Capello
7e1e9a238e Write/read user data from layers when recovering lost sprites (fix #2373) 2020-05-08 18:31:48 -03:00
David Capello
46f4002368 Fix crashes saving sprites with '%' char in their filename
To fix this we changed the way StatusBar text is handled (we are using
fmt::format() in StatusBar instead of printf-like ... args now).
2020-05-08 17:39:55 -03:00
David Capello
a54e2ce13f Fix eraser tool/stylus tip when dynamics for gradients are on 2020-05-07 21:40:03 -03:00
David Capello
7b105261ea Fix syncing brush size/angle with max values after opening dynamics popup 2020-05-07 18:39:58 -03:00
David Capello
4123e98d16 Add option to switch dynamic gradient between BG>FG and FG>BG 2020-05-07 16:08:32 -03:00
David Capello
4087bd5782 Merge branch 'master' of https://github.com/grauw/aseprite into grauw-master 2020-05-07 14:04:17 -03:00
David Capello
c3ebf40cb1 Fix shading ink for RGB and Grayscale modes
The colors in the shades are not necessary to be in the palette or
related to a palette index in these modes (or even more, the color
palettes can be duplicated), the only important things are the values
in the shades for RGB and Grayscale, so in these modes now we access to
ToolLoop::getShade() directly and create a mini-palette to find the
colors there (ignoring the sprite palette completely).
2020-05-06 17:14:47 -03:00
David Capello
6294ac74e0 Fix accessing to invalid indexes in the doc::Remap created for ColorShades
This can happen when we've configured a set of color entries in the
shading ink and then we switch between documents with different color
palettes, etc.
2020-05-05 20:13:53 -03:00
David Capello
056cd3cdfc Minor changes in ColorShades member functions to avoid copying a Shade object 2020-05-05 20:10:54 -03:00
David Capello
82ab0bc40a Avoid creating an extra brush for the brush preview 2020-05-05 19:42:07 -03:00
David Capello
263236deb3 Several fixed for Dynamics
* Now the max value in dynamics is equal to the brush size, so changing
  the brush size (e.g. switching between pencil/eraser tools) will
  change the max brush size (which is the most common parameter to
  change)
* Added mini_slider style for min/max brush/angle values
* Fixed some issues clicking outside the dynamics popup
2020-05-02 11:59:34 -03:00
David Capello
cc7bdbcec4 Add a slider style in theme
We've added some code to handle backward compatibility with themes. In
this way we can still load old themes in the latest version but should
look as in previous versions (this will not be done with previous
properties or parts migrated to styles, so we start from now on).
2020-05-01 23:31:10 -03:00
David Capello
3555bbe29f Fix Show Brushes/Dynamics commands to switch the popup 2020-05-01 13:38:12 -03:00
Laurens Holst
b3681fdbb0 [lua] Implement Dialog:modify for more properties
Support modifying the following properties:

Dialog:number { decimals }
Dialog:slider { min, max, value }
Dialog:combobox { option }
Dialog:color { color }
Dialog:shades { colors }
Dialog:file { filename }
2020-04-30 22:47:00 +02:00
David Capello
0ad50373d3 Enable dynamics for Eraser 2020-04-30 09:02:05 -03:00
David Capello
b989b46ff2 Log warnings about widget styles only on debug build 2020-04-30 08:45:34 -03:00
Laurens Holst
1311173d97 [lua] Add missing Dialog onchange and onrelease events
Adding the following events:

Dialog:entry { onchange }
Dialog:number { onchange }
Dialog:slider { onchange, onrelease }
Dialog:combobox { onchange }
2020-04-29 23:38:15 +02:00
David Capello
776336320f Fix issues encoding TGA files 2020-04-29 17:42:14 -03:00
David Capello
682b2c230c Fix ASSERT that can fail when loading a sequence of files 2020-04-29 17:30:47 -03:00
David Capello
99a9ee49cb Fix crash at start up on trial version (when !ENABLE_SCRIPTING) 2020-04-25 09:38:19 -03:00
David Capello
2418a075ca Restore DynamicsField selected status when popup is closed 2020-04-24 13:39:03 -03:00
David Capello
a6c55b0210 Fix DynamicsPopup::MinMaxSlider when UI scale change 2020-04-24 12:34:54 -03:00
David Capello
b6a86e6aea Fix DitheringSelector widget issues with UI Scaling changes 2020-04-24 12:25:24 -03:00
David Capello
1d5edd6dc1 Fix min/max marks X positions in DynamicsPopup sensors 2020-04-24 12:04:56 -03:00
David Capello
79900db158 Fix issue showing the dynamics popup when the UI scaling changed 2020-04-24 12:04:36 -03:00
David Capello
c99a566635 Refactor velocity sensor with tools::VelocitySensor class 2020-04-24 11:19:35 -03:00
David Capello
bb07d25025 [osx] Fix some leaks regenerating native menus 2020-04-24 09:24:42 -03:00
David Capello
7ad1b7b965 Simplify handling of dithering matrices in extensions to avoid memory leaks 2020-04-23 23:41:08 -03:00
David Capello
fa54bb1950 Fix memory leak in load_document() 2020-04-23 23:32:09 -03:00
David Capello
9fd9ea365f Fix regression introduced with dynamic gradients
Now inks need a prepareForPointShape() call.
2020-04-23 20:26:18 -03:00
David Capello
1d15bacdcd Add sensor tweaks to specify min/max thresholds of the sensor input
In this way we can translate the sensor input to a better output range
for our specific device (mouse, stylus, etc.).
2020-04-23 18:03:34 -03:00
David Capello
4cfa5e743e Add addition mode back for Hue/Saturation filter (fix #1848) 2020-04-23 12:05:09 -03:00