Commit Graph

6553 Commits

Author SHA1 Message Date
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
David Capello d1843fcf55 Fix interpolation between stroke points with line brush (fix #728)
Related to #245, and there are still problems with gaps using new
dynamic angle parameters.
2020-04-23 11:30:36 -03:00
David Capello 3b370c2ff5 Minor formatting changes 2020-04-22 20:20:04 -03:00
David Capello 3c1ea2f407 Add/process dynamic data in/from stroke points (related to #710)
* Converted Stroke points from gfx::Point to Stroke::Pt
* Process gradient data to create shading betweens points or dithering
  with new doc::Brush patterns
2020-04-22 20:17:14 -03:00
David Capello 79f9e28ce8 Added pen pressure sensitivity (fix #710)
- Added support to detect eraser tip on Linux (#610)
- Related to #139
- Still needs works for gradients and better brush interpolations
  between stroke points
- Requested several times, e.g. https://community.aseprite.org/t/1077
  https://community.aseprite.org/t/1881, steam forum, etc.
2020-04-21 22:27:49 -03:00
David Capello 5affdbbae1 Shox extensions in different categories in the Preferences dialog 2020-04-20 14:20:07 -03:00
David Capello ff3e9504fd Fix crash disabling extensions 2020-04-20 14:11:48 -03:00
David Capello 1f34d0e46e Add different formulas to convert RGB to Grayscale 2020-04-20 10:22:41 -03:00
David Capello 07f1510ebd User can configure "auto select layer" in quick mode independently
Now we have one "auto select layer" option for the quick mode of Move
tool (Ctrl/Cmd key, true by default) an other option for the regular
Move tool mode (false by default).
2020-04-18 21:21:14 -03:00
David Capello f689c2c48e Fix compilation of trial version 2020-04-17 18:31:03 -03:00
David Capello e56cc15326 Add possibility to use New Layer via Cut/Copy with ranges
Requested here: https://community.aseprite.org/t/5222
2020-04-17 16:13:22 -03:00
David Capello fb68407e04 Add support to call Flip command without UI 2020-04-17 12:32:10 -03:00
David Capello c0d4264789 Fix crash loading some kind of .zip extensions w/filename w/Unicode chars 2020-04-17 10:58:47 -03:00
David Capello 9a06deb0e6 [lua] Clear selected colors with app.range:clear() too 2020-04-16 21:26:28 -03:00
David Capello e149f76934 [lua] Add Range.layers/frames setters and Range:clear() 2020-04-16 19:19:18 -03:00
David Capello 48e941cb2f [lua] Add Dialog:newrow{ always } 2020-04-16 11:48:44 -03:00
David Capello 7482024827 [win] Fix opening files from File Explorer in the running instance through DDE messages 2020-04-16 11:19:39 -03:00
David Capello 58e78ad886 [win] Disable warning 4244 on MSVC 2020-04-16 11:18:45 -03:00
David Capello 2af6a0493e Fix recent list of files menu
This is a problem introduced with the plugin groups, but now we use a
group to store the list of recent files. With this commit we fixed
some bugs in the impl of menu groups.
2020-04-08 17:50:17 -03:00
David Capello 85af3ce735 Fix Widget::previousSibling() impl 2020-04-08 17:48:26 -03:00
David Capello 8b1b624320 Replace NULL to nullptr in ui library 2020-04-08 17:48:06 -03:00
David Capello b491e589fd Remove unused variable 2020-04-08 17:29:47 -03:00
David Capello be79b519ad Fix linker error when compiling without -O2 (e.g. debug mode) 2020-04-08 12:25:23 -03:00
David Capello b628e21e76 Replace MIN/MAX() macros with std::min/max() functions 2020-04-08 12:20:53 -03:00
David Capello 86259a64fc Replace MID() macro with base::clamp() function
In the future we will replace base::clamp() with std::clamp().
2020-04-07 19:47:16 -03:00
David Capello fd651c4189 Set alpha=255 if the current color is MaskType when picking colors from ColorSelectors
This is a little UI improvement: If we've just picked the mask color,
and click a color selector, generally we would like to use the opaque
version of that color (instead of the completely transparent version
of that color, alpha=0, which is an useless option).
2020-04-07 12:04:07 -03:00
David Capello ed5deb9ca3 [lua] Add Dialog:color{ onchange } event 2020-04-07 11:25:58 -03:00
David Capello 4eefb84cf3 [lua] Add possibility to change dialog title with Dialog:modify{ title=... } 2020-04-07 11:14:06 -03:00
David Capello bb8d0e7a6a [lua] Add possibility to modify a widget label and focus it 2020-04-07 11:13:30 -03:00
David Capello 8fe01b43f6 Fix typo in dialog_class.cpp 2020-04-07 11:01:46 -03:00
David Capello 482fcd3b8c Fix crash when loading plugins from CLI and compilation when !ENABLE_UI 2020-04-07 10:56:48 -03:00
David Capello a7f3fc968a Fix compilation when !ENABLE_SCRIPTING 2020-04-07 10:44:26 -03:00
David Capello c1a62510a5 Fix crash clicking and deleting layers from timeline sequentially (and quickly
Reported in https://igarastudio.zendesk.com/agent/tickets/656
2020-04-07 10:40:56 -03:00
David Capello 8d8c116fa8 [lua] Fix some Dialog functions to convert to string implicitly 2020-04-06 14:54:11 -03:00
David Capello 3cd97c9822 Fix crash starting the program for first time (fix #2330)
Regression introduced in 6b6b9057bf
2020-04-05 20:47:52 -03:00
David Capello 55a1fa8b81 [lua] Add Dialog:modify{} method to change widget properties 2020-04-04 19:42:44 -03:00
David Capello 2c3fd2171b [lua] Fix Dialog.data for checkboxes if the last pressed button was a checkbox 2020-04-04 19:41:30 -03:00
David Capello 150ca293ef [lua] Fix checking for missing fields on tables in Dialog methods
We've to use LUA_TNIL instead of LUA_TNONE.
2020-04-04 19:40:52 -03:00
David Capello c73d745245 Don't show warning for untranslated text that start with '!' on widgets 2020-04-04 17:33:23 -03:00
David Capello 9da4b76976 Possibility to scroll menus (fix #2263) 2020-04-03 17:56:35 -03:00
David Capello 298c2e24e8 Add possibility to put plugin:newCommand{} in specific menu locations identified as "groups" (#1949) 2020-04-02 23:18:08 -03:00
David Capello 6b6b9057bf Add support for scripts on extensions (#1949)
It still need some work to associate the command to menus easily.

Related issues:
  https://github.com/aseprite/aseprite/issues/1403
  https://github.com/aseprite/aseprite/issues/1949
  https://github.com/aseprite/api/issues/20
  https://community.aseprite.org/t/lua-script-extension-and-menu-api/5085
2020-04-02 20:21:21 -03:00
David Capello 9609e541e5 Fix some issue with saved defaults (selection mode and snap to grid)
These two preferences are confusing when saved with non-default
values. For example, snap to grid should be almost always turned off
and turned on only when the user do it explicitly.

The other one is the subtraction selection mode, if we save that as a
default mode, users will find that the selection tool stop working
when the program is re-started.

Both of these issues generated user support over all these years.
2020-03-30 10:39:07 -03:00
David Capello d358e6055f Add auto-fit screen option (fix #789, fix #2267) 2020-03-30 09:16:14 -03:00
David Capello 70afe4195e [lua] Add Image(sprite) constructor (renders the first sprite frame) 2020-03-28 13:28:30 -03:00
David Capello c7b3e15d05 [lua] Fix crash using invalid width/height in Image() 2020-03-28 13:28:25 -03:00
David Capello 76ef344f49 [lua] Support to use Image:drawSprite(sprite) without frame to render the first frame 2020-03-28 13:28:18 -03:00
David Capello 32fd67e187 [lua] Add ev.button property onclick of shades widget 2020-03-27 16:14:00 -03:00
David Capello 09ea577a08 Match ui::MouseButton values to os::Event::MouseButton 2020-03-27 15:40:43 -03:00
David Capello 2c42f8670a Update tga module (again, trying to fix compilation errors in CIs) 2020-03-25 19:52:23 -03:00
David Capello 2a0751c6dd Update tga module 2020-03-25 19:09:55 -03:00
David Capello ba1a8611a9 Use ASSERT instead of assert 2020-03-25 18:42:24 -03:00
David Capello f532539a76 Minor change in flic library 2020-03-25 18:31:20 -03:00
David Capello 780133be6f Use tga library to encode files 2020-03-25 18:31:14 -03:00
David Capello 538dc9e6aa Fix loading fully transparent TGA images in 32 bpp 2020-03-25 11:11:13 -03:00
David Capello 319c89c2ad Use the new tga library to decode tga files 2020-03-24 17:07:35 -03:00
David Capello 4f1eacfddc Simplify bits scaling function from 3/5/6 bits to 8 bits 2020-03-24 17:02:15 -03:00
Hamed Zaghaghi 123fa7d106 add css export 2020-03-24 05:51:02 +04:30
David Capello 5c0a82e9e0 Update FLIC library 2020-03-23 11:33:09 -03:00
David Capello b95b01aa9a Fix loading invalid FLIC or with huge image sizes 2020-03-21 20:54:41 -03:00
David Capello 72b5f0e701 Add missing files for the new TGA options 2020-03-20 20:15:29 -03:00
David Capello c230e8f0ab Add options to save TGA files with 16/24/32bpp & uncompressed/compressed 2020-03-20 19:18:03 -03:00
David Capello ffdb5f2e42 Update status bar and mouse cursor when editor scroll changes 2020-03-20 15:04:53 -03:00
David Capello 3b9274b9b5 Improve TGA encoder to save files compressed 2020-03-20 12:35:27 -03:00
David Capello 1826d66f10 Fix loading some particular TGA files (multiple scanlines compressed, invalid alpha information, etc.) 2020-03-19 20:52:03 -03:00
David Capello de1019342a Fixes for aseprite.desktop file (fix #2295) 2020-03-19 12:13:51 -03:00
David Capello 941219363b Keep "Export File" window position saved on preferences (fix #2300) 2020-03-19 09:50:18 -03:00
David Capello 28248bf228 [lua] Add Tag.color property (fix https://github.com/aseprite/api/issues/24) 2020-03-19 08:41:29 -03:00
David Capello a0882ba443 Move PACKAGE/VERSION, etc. to new ver-lib
* As we moved the VERSION macro to a .c file, we don't have to
  recompile the whole project when we change the version number.
* Removed the version number from gui.xml
* Removed the invalid first menu item that might appear in the root
  menu when the gui.xml version is outdated in debug mode.
2020-03-16 10:31:32 -03:00
David Capello 609b9accfc [win] Fix error entering to files as a folder when the full path is used in the file selector 2020-03-11 12:27:31 -03:00
David Capello fd8beb573c We can use slashes in the file selector to go to other folders 2020-03-11 12:26:58 -03:00
David Capello a19e317212 Merge branch 'fix/2228' of https://github.com/Adrijaned/aseprite into fix-2228 2020-03-11 09:51:32 -03:00
David Capello afefac73bd Fix compilation when !ENABLE_UI 2020-03-09 10:59:28 -03:00
David Capello 3f3928cdf2 Fix invalid var name 2020-03-06 15:32:40 -03:00
David Capello 1fe3c3a4bc Add a number to each new slice that is created (related to #1651) 2020-03-06 15:18:10 -03:00
David Capello 99cb95357a Add support to send crash reports from macOS 2020-03-06 14:45:13 -03:00
David Capello b106e2c717 Update clip module 2020-03-02 23:09:19 -03:00
David Capello 302dcdc7cf Fix Shift+Enter to play animation in Preview window (fix #2249) 2020-03-02 14:49:38 -03:00
David Capello 95b655168c Use new laf + skia m81 branch
* Some minor refactors due laf changes.
* Updated the instructions to compile Aseprite linking to external
  skia instructions and pre-built packages.
2020-03-01 23:42:08 -03:00
David Capello eaa2dd14b6 Update submodules 2020-02-27 12:15:41 -03:00
David Capello 817c6e361f Fix crash closing/reopening sprites when "keep closed sprite data in memory" is disabled 2020-02-27 12:02:01 -03:00
David Capello e3f28acf9e Fix deleting docs from memory when "keep closed docs alive" is disabled & the backup on disk is enabled 2020-02-27 11:32:18 -03:00
David Capello f0e60d2068 Fix crashes using MaskByColor command after we cannot lock the sprite
If ContextWriter thrown an exception (i.e. we cannot lock the sprite
for writing purposes), the "Mask by Color" ui::Window would persist
with its signal slots, and it creates an unstable scenario where color
change signals are generated from sliders and crashes the program
because we were using a deleted ContextReader variable which was
stored in the stack in MaskByColorCommand::onExecute().
2020-02-26 12:49:23 -03:00
David Capello 5cd23b8522 Fix moving 9-slices rules (regression introduced in 73de6c8b1d) 2020-02-25 15:25:36 -03:00
David Capello 53cb226f09 Fix crash using Flatten Visible when the active layer is a child of a group 2020-02-25 14:12:20 -03:00
Gaspar Capello 54bb39a9d3 Fix tile mode glitch with image brushes
This fix solves u,v set calculation when 'image brush' are used.

The cause of this bug is that we considered the set m_u, m_v as constants.

We have several cases when we are working on X axis:
- Scanline entirely contained in a tile, but OUTSIDE of the reference tile.
- Scanline entirely contained in a tile, but INSIDE of the reference tile.
- The left side of a scanline which was sliced (by the tile limit).
- The right side of a scanline which was sliced (by the tile limit).
Each one has its own m_u, so we need to recalculate it before every loop->getInk()->inkHline(...).

We have to take similar considerations when we are working in the Y axis.
We need recalculate m_v according if 'y+scanline.y' is INSIDE or OUTSIDE of the reference tile, each case has its own m_v.

Bug reports:
* https://community.aseprite.org/t/1183
* https://community.aseprite.org/t/4695
2020-02-20 16:01:12 -03:00
David Capello 9fe05a5dd5 Fix crash double-clicking a moving selection (fix regression in 7b07f29f0b)
Here we avoid two ExpandCelCanvas at the same time with
MovingPixelsState + DrawingState. Double-clicking inside the selection
when we are moving it (MovingPixelsState) could start a new
DrawingState which creates a new ToolLoopImpl that needs a new
ExpandCelCanvas. So we have to drop the pixels before.
2020-02-17 08:28:30 -03:00
David Capello 7b07f29f0b Add possibility to select multiple tiles with double-click + dragging mouse (fix #1988)
Fixes: https://community.aseprite.org/t/1929
Related to #939
2020-02-16 12:42:29 -03:00
David Capello 6b7a593858 Minor formatting change in SelectTileCommand 2020-02-14 14:32:28 -03:00
David Capello a1317eaede Show some extra debug info if Object::setId() assert fails 2020-02-12 23:07:00 -03:00
David Capello 294401b18a Select the correct tile when we double-click on negative coordinates of the grid 2020-02-11 12:43:29 -03:00
Gaspar Capello f8cca1eba4 Removed unnecessary lines in remap.cpp 2020-02-11 09:24:24 -03:00
Adrijaned 90ba6d77dd Fix file selector not allowing choosing files by path 2020-02-09 17:42:46 +01:00
David Capello 47a568ee86 Resize selection correctly on "Sprite Size" even when the Bilinear method is used 2020-02-07 15:11:03 -03:00
David Capello 59fa7d956b DocExporter: Don't share the original size between samples
If we use two sprites with different canvas sizes, and both sprites
have a similar cel, they can share the inTextureBounds, but not the
original size (which is the original sprite canvas size of each cel).
This can be reproduced using the CLI and creating a texture
atlas (-sheet) with two or more sprites.
2020-02-06 15:07:40 -03:00
David Capello a7f1f4bd64 DocExporter: render samples with trimmed size
This fix an issue merging similar cels from different sprites with
different canvas sizes.
2020-02-06 14:23:33 -03:00
David Capello 00cdda7b85 Minor change in DocExporter 2020-02-06 12:01:29 -03:00
David Capello 1c39d907cb Fix bug genering "spriteSourceSize" for similar cels but with different positions in the canvas
This can happen when we use -trim (Trim Cels) + -merge-duplicates
options together. The trimmed bounds are unique to each sample, and
only the position in the texture (inTextureBounds) can be shared.

Fixes: https://igarastudio.zendesk.com/agent/tickets/407
2020-02-06 11:59:29 -03:00
David Capello df74444347 Now ContextWriter will always wait 1/2 second to unlock the backup thread 2020-02-05 17:50:17 -03:00
David Capello d316781e8a Remove usage of ContextWriter from all Command::onEnabled() impls 2020-02-05 17:39:56 -03:00
David Capello 7306a685f8 Fix random bug showing disabled menu items right-clicking the timeline
When the backup thread is running, the upgradeToWrite() needed some
extra time to lock the document to check if we can write or not in the
sprite. Now we just check the ability to write the sprite with the new
RWLock::canWriteLockFromRead() function.
2020-02-05 17:03:48 -03:00
David Capello 28969d968c Finally removing a problematic assert from ~UIContext() 2020-02-05 12:23:11 -03:00
David Capello 66864beb77 lua: Fix crash calling app.refresh() from a script using -b -script from CLI 2020-02-05 12:18:12 -03:00
David Capello 7507c2e4eb Minor change in BrushLockAlphaInkProcessing<IndexedTraits>::processPixel()
We can use m_transparentColor directly (as in other inks) and ask for
the transparent color before pre-processing the pixel if it's not
needed.
2020-02-04 12:51:02 -03:00
David Capello 1bb126fade Fix pasting text on empty cel when the timeline range is enabled
Bug report: https://community.aseprite.org/t/4489
2020-01-30 19:47:23 -03:00