Commit Graph

7329 Commits

Author SHA1 Message Date
David Capello
47aae7fc07 [lua] Support expressions like: app.range.slices=app.activeSprite.slices
Using lua_geti() we can iterate the SlicesObj as a table.
2022-08-31 11:28:37 -03:00
David Capello
6dce23540a [lua] Move app.selectedSlices to app.range.slices
The biggest motivation was that the Range object is already used to
get/set selected objects in the UI, and it's the range used in
operations like Edit > Delete command (which is the case for slices).
2022-08-31 11:17:34 -03:00
lampysprites
4d65b5c925 [lua] Add app.selectedSlices field 2022-08-31 10:36:00 -03:00
David Capello
2789e41d48 [lua] New API version 20 2022-08-31 09:36:27 -03:00
David Capello
6da4000e6c Make Enter key to "Agree" loading the animation sequence when we modify the duration field 2022-08-31 09:11:59 -03:00
lampysprites
c67902dee3 Request frame duration when opening sequences 2022-08-31 09:06:16 -03:00
Gaspar Capello
277e24c799 Minor refactor on old macros within BMP format 2022-08-30 14:44:47 -03:00
David Capello
1335d65c41 Merge branch 'main' into beta 2022-08-30 14:22:17 -03:00
David Capello
877b5e00a3 Add color_scales_tests 2022-08-30 14:14:06 -03:00
Gaspar Capello
bdcabdedf3 Add extended support to BMP files (fix #3277, fix #1495)
Before this addition, Aseprite supported following BMP formats:
- Size = 12 (OS/2 BMP 1.0)
- Size = 40 (Windows BMP v3)

Now extended support has been added to the BMP extension:
- Load BMP files with BMP header size:
  - Size = 12 (OS/2 BMP 1.0)
  - Size = 16 (OS/2 BMP 2.0 - size 16)
  - Size = 24 (OS/2 BMP 2.0 - size 24)
  - Size = 40 (Windows BMP v3)
  - Size = 52 (BITMAPV2INFOHEADER)
  - Size = 56 (BITMAPV3INFOHEADER)
  - Size = 60 (OS/2 BMP 2.0 - size 60)
  - Size = 64 (OS/2 BMP 2.0 - size 64)
  - Size = 108 (BITMAPV4INFOHEADER) at the moment colorimetry isn’t supported.
  - Size = 124 (BITMAPV5INFOHEADER) at the moment ICC profiles not supported.
- Load BMP with alpha channel.
- Load BMP 2bit color depth.
- Export BMP files with alpha channel (not palette based).
2022-08-30 13:34:32 -03:00
David Capello
bc16ab3a71 Fix crash accessing a deleted display using parentDisplay() (fix #3491, fix #2907)
This might be a fix for two frequently reported crashes from Sentry:

1) In Manager::_closeWindow() (#3491): We can reproduce this bug (without
this patch) pressing Ctrl+S to save the active sprite and clicking
randomly in the menu bar (File, Edit, etc. options) to open other menu
boxes (a crash can happen when multiple windows UI is enabled).

2) In set_native_cursor_on_all_displays() (#2907): We weren't able to
reproduce this bug.
2022-08-29 20:01:50 -03:00
David Capello
e87cb2dd8f Merge branch 'main' into beta 2022-08-23 15:24:02 -03:00
David Capello
8a7f6930d0 Fix minor memory leaks loading palettes using std::unique_ptrs 2022-08-23 15:08:01 -03:00
David Capello
ab4088502c Use FileAbstractImage in .fli and .webp file formats (#3008) 2022-08-23 11:33:03 -03:00
David Capello
2f34e25f06 Merge branch 'export' into beta 2022-08-19 18:05:36 -03:00
David Capello
38270fff5b Add --extrude CLI option (fix #2072) 2022-08-19 17:34:16 -03:00
David Capello
acb246e26b Add "Sprite Grid" source option to Export Sprite Sheet (fix #1982)
In this way we can export each grid cell/tile as an individual sprite,
and use the extrude option on each grid cell. We've added the
--split-grid CLI option too.
2022-08-19 17:21:56 -03:00
David Capello
a2f61a3378 Add "File > Export > Export Tileset" option (#3240)
Now we can export one (or several) tilesets in one sprite sheet (using
the same options that are available in the Export Sprite Sheet dialog,
e.g. like extruding tiles, related to #1982 in some way).

Some changes:

* New "Source" field and fromTilesets param for ExportSpriteSheet
  command
* New ExportTileset command (which acts like ExportSpriteSheet but
  with fromTilesets=true by default)
* Added --export-tileset CLI option
2022-08-18 14:56:43 -03:00
David Capello
d0701c61ca Merge branch 'main' into beta 2022-08-18 13:54:11 -03:00
David Capello
9f8df8e914 [win] Fix aseprite-thumbnailer with new changes from a66c170ded 2022-08-18 13:53:20 -03:00
David Capello
83857ea600 Merge branch 'main' into beta 2022-08-17 22:58:12 -03:00
David Capello
a66c170ded Add render::BgOptions to simplify some code 2022-08-17 22:40:25 -03:00
David Capello
4e12e427ef Rename "checked" -> "checkered" (background, drawing routines, etc.)
Also rename setBgCheckedSize -> setBgStripeSize in case we add new
background patterns (like horizontal/vertical/diagonal stripes, etc.)
2022-08-17 22:19:07 -03:00
David Capello
2367c8526b Replace deprecated macro TYPED_TEST_CASE with TYPED_TEST_SUITE 2022-08-17 21:46:33 -03:00
David Capello
bdee7d98fe Use std::unique_ptr for selected layers/frames in DocExporter::Item 2022-08-17 12:50:41 -03:00
David Capello
a13423bd70 Add the logic side to export the selection only (fix #645) 2022-08-12 20:11:25 -03:00
David Capello
3c3d2dafe6 Add Area element in the Export window (UI only) (#645) 2022-08-12 17:25:40 -03:00
Gaspar Capello
e6c90334f9 Fix scrollbar for the Extensions list in Preferences is missing on the first open (fix #3456) 2022-08-10 12:01:28 -03:00
David Capello
71b91cf6ed Merge branch 'main' into beta 2022-08-09 16:26:52 -03:00
David Capello
3a917492ee Fix crash showing color selector when GPU is enabled
It looks like the internal surface has a nullptr color space.
2022-08-09 16:11:57 -03:00
Gaspar Capello
19b18d2a63 Fix reference layer scaled incorrectly after Sprite > Sprite Size (fix #3461) 2022-08-09 15:30:20 -03:00
Gaspar Capello
7a8cd2683e Don't keep DraggingValueState after closing a command dialog (fix #3445)
Before this fix, when the Sprite Size dialog was opened using the
Ctrl+Alt+I key combination, then closed, the brush size changed as the
cursor moved (without even pressing Ctrl+Alt modifiers), keeping the
DraggingValueState alive.
2022-08-08 18:00:48 -03:00
David Capello
09626b2c0c Fix possibility to dock/drop tabs to sides/tabs (fix #3453)
Bug reproducible only with multiple windows and generally small Screen
Scaling factor (100%).
2022-08-08 17:22:39 -03:00
Gaspar Capello
add1128248 Fix RotSprite transparency bug (fix #3444) 2022-08-08 10:37:32 -03:00
David Capello
da636253ee Fix scale factor when using the "Export for Twitter" (fix #3465)
Regression introduced in b7d5d4a2c9
2022-08-08 10:29:36 -03:00
Martín Capello
daa9b40a07 Fix eyedropper quick tool when preview window is visible (fix #3236)
Co-authored-by: David Capello <david@igara.com>
2022-08-08 09:56:37 -03:00
David Capello
854bb2e8f3 Fix WheelAction::ToolSameGroup/ToolOtherGroup in DraggingValueState (fix #3459)
These actions weren't working correctly because we have to take
special care when we change the tool group, i.e. the "initial
position" used to calculate the delta from "mouse pos - initial pos"
must be updated to reset the delta to change tools inside the same
tool (this is the new m_initialPosSameGroup member variable).
2022-08-08 09:44:04 -03:00
David Capello
c62aa571aa Possible fix rendering reference layers in nonreproducible scenario (fix #3460)
This is a patch, but we don't know why this can happen, so it's highly
probable that other kind of crashes might appear in the near
future (or this doesn't fix the original bug).
2022-08-05 10:30:17 -03:00
Gaspar Capello
12e59b887f Add remember new tilemap layer base index (fix #2735) 2022-08-04 14:30:11 -03:00
David Capello
05bf34f084 Merge branch 'main' into beta 2022-08-02 16:48:32 -03:00
Gaspar Capello
55885ee266 Fix regression: TextBox isn't rendering text (doesn't update the bounds area of the text box)
Regression in dd0c296209 (Use
tooltip_text style & color to paint tooltip windows #2554).

Prior this fix, text box does not update its bounds area because it
has not a style assigned.

Fix #3442, fix #3443
2022-08-02 16:39:18 -03:00
David Capello
3e6360d024 Fix crash using deleted os::Surface (fix #3451)
It looks like processing a specific kPaintMessage with
ui::Widget::sendMessage() might re-create the os::Surface and destroy
the previous one, so we need to keep a reference to the previous
surface just in case to keep it alive.

We aren't able to reproduce this crash, but we've received several
Sentry reports about it, only on Windows and since v1.2.34.1 (not sure
if it's related to that). We'll see if this does fix the crashes or we
have some kind of regression in the future.
2022-08-02 16:22:13 -03:00
David Capello
db38a56558 Merge branch 'main' into beta 2022-07-20 16:10:40 -03:00
David Capello
52b1899e9d Fix crash Ctrl+clicking an ill-formed reference layer cel with width/height < 1.0
The width/height of a reference layer cel cannot be < 1.0, but in the
extreme case where this happens, Ctrl+clicking the reference layer
shouldn't crash the program.
2022-07-20 15:18:49 -03:00
David Capello
571134c1b4 Add option to apply Saturation/Value to Hue slider in Tint/Shade/Tone optionally
This was changed in df33744c85, but now
we're adding an option to switch between both behaviors. We prefer to
keep the old behavior as the default one and the new one as an
optional preference.

Related to: https://community.aseprite.org/t/15065
2022-07-20 12:47:50 -03:00
Martín Capello
22de483fc7 Remove "Enter license" menu item when DRM feature is not enabled 2022-07-19 15:43:31 -03:00
David Capello
3db8267270 Merge branch 'main' into beta 2022-07-19 10:35:13 -03:00
David Capello
da58670dd0 Revert "Add '{title}' and '{layer}' functionality to the Export dialog (fix aseprite/aseprite#3363)"
Fix crash reported on v1.2.36/v1.3-beta17, ctx->activeDocument() can
be nullptr.

This reverts commit 1f5e4cfc4f to fix #3431
2022-07-19 10:29:16 -03:00
David Capello
5ec88ad659 Merge branch 'main' into beta 2022-07-18 16:05:37 -03:00
David Capello
dd0c296209 Use tooltip_text style & color to paint tooltip windows (fix #2554) 2022-07-18 16:00:13 -03:00
David Capello
db1faf8f7b Merge branch 'main' into beta 2022-07-18 15:32:27 -03:00
David Capello
7c8153b5ec Use selection bounds if they're visible on ImportSpriteSheet by default 2022-07-18 12:47:54 -03:00
David Capello
df33744c85 Improve color selector shaders
* Removed conversion from RGB -> HSV/HSL for each pixel (we just pass
  the HSV/HSL values directly to the shader). In this way we don't
  lost some hue information for some special cases like white/black
  colors (probably related to: https://community.aseprite.org/t/14904)
* Now Tint/Shade/Tone selector changes the aspect of the Hue slider
  depending on the current saturation/value (this was changed in the
  non-shader version too)
2022-07-18 12:01:12 -03:00
David Capello
4389788a1d The document associated w/SpriteEvents can be nullptr in special cases
SpriteEvents can be re-created just when we're closing the sprite if
we access Sprite.events property in app 'sitechange' event. When this
second instance of SpriteEvents is deleted after the sprite was
closed, the document cannot be found (as it was already destroyed).

Associated test:
02a2f1f933
2022-07-16 13:14:24 -03:00
David Capello
f7dee88901 Fix uninitialized rgbmap (found w/MSVC debug, GitHub actions failed)
Regression from 2785a9fef7
2022-07-16 11:47:52 -03:00
David Capello
1912053f33 Merge branch 'main' into beta 2022-07-15 17:30:39 -03:00
David Capello
f4e83371b8 Several minor improvements to the status bar
* Remove "%3d" for integers (just use "%d"), this is a legacy format
  when the text was a monospace font (it was present from the very
  beginning of the times, when we used the Allegro font)
* New :delta: icon (before :offset: which didn't exist in the theme)
* Show useful info for MovingCelState: mainly cel bounds
2022-07-15 17:03:18 -03:00
David Capello
7e19592470 Preview the modified image for brush slots that don't save image colors
This is to show the brush image with the new fg color in the brush
popup instead of the original image when image colors shouldn't be
preserved for that specific slot.
2022-07-15 12:49:48 -03:00
David Capello
c6e3ca0d8b Fix memory leak with IntEntry popups 2022-07-15 12:46:54 -03:00
David Capello
60a4ebf8f6 Minor change in StatusBar::showColor() to use std::string/fmt::format 2022-07-15 12:30:15 -03:00
David Capello
44bb1c4e48 Fix bug losing original image colors from custom brushes (fix #3375) 2022-07-15 10:05:50 -03:00
Gaspar Capello
f7b6674680 Fix Marqueed selection gets some rows duplicated when moved left and right over left canvas edge with Ctrl still pressed #2891
Prior to this fix, moving a marquee selection while holding down the Ctrl key outside the left/top area of the canvas results in a 1px distortion of the marquee image. This distortion is due to a false transformation when it is required to get the corner bounds, due to rounding the float coordinates towards 0 instead of the nearest left/top integer. The discrepancy occurs within the `getDraggedImageCopy`, `redrawExtraImage`, `drawImage` and `drawMask` functions.
2022-07-14 14:41:01 -03:00
Gaspar Capello
2785a9fef7 Remove fillOrphansNodes(), now new colors are added to the octree color arragement
This gives more accuracy in the color picking criteria on new images
pasted into an INDEXED sprite.

Also, added findMaskColor to fix the behavior reported in #3207

Both issues are related when RGBMAP is created. The 'mask color' and
'mask index' must be defined correctly to include/exclude during the
table/octree map color search.

To do: Converting sprite to INDEXED should add 'mask color' to the
palette when color count < 256 and transparent color isn't in the
palette.
2022-07-14 14:27:20 -03:00
David Capello
1621973298 Merge branch 'issue-3417' into main 2022-07-14 14:11:13 -03:00
Gaspar Capello
54443ad20d Add other color comparison criteria to findBestfit (first step to #2787) 2022-07-14 14:08:39 -03:00
David Capello
f8f925c634 Merge branch 'main' into beta 2022-07-13 19:49:03 -03:00
David Capello
57064e6d16 Update submodules (laf, clip) 2022-07-13 18:16:23 -03:00
David Capello
f14fad77eb Fix std::clamp() assert fail when scrollbars are too small 2022-07-13 16:47:20 -03:00
Joseph-Eugene Winzer
da81c0266d Fix empty undo history crash (fix #3417)
m_undoHistory is not valid for tabs other than sprites. For example
opening the README or Home tab does not initialize the undo history,
thus aseprite will segfault when it tries to get its first entry.
2022-07-13 05:18:04 +02:00
David Capello
9a3958278b Fix bug moving a cel, flattening all layers, and then undoing (fix #3416)
The m_boundsF position read from doc::read_celdata() was overwritting
the position of the cel when it was restored from the undo
information.
2022-07-11 10:24:43 -03:00
David Capello
62c052dd40 Use a std::unique_ptr for m_boundsF in doc::CelData 2022-07-11 10:21:38 -03:00
David Capello
d46724329f Minor improvement in FlattenLayers to avoid some cmds
Instead of creating cmd::SetLayerName and cmd::MoveLayer, we can add
the layer with its name and in the correct place directly.
2022-07-11 10:10:36 -03:00
David Capello
6e0394b7dc Fix using MoveMask command without visible selection
Issue found testing #2796 without selection/without calling SelectTile
command.
2022-07-07 16:33:39 -03:00
David Capello
daa7cc837a Minor change: Add const to some pointers in write_layer() 2022-07-07 16:10:51 -03:00
David Capello
8fe88606c6 Fix possible std::clamp() assert fail 2022-07-07 16:08:40 -03:00
David Capello
1b76076c52 Fix clicking a menuitem that is above another parent menubox/bar (fix #3386) 2022-07-07 16:07:22 -03:00
David Capello
4f2eae6b77 Use C++17 [[fallthrough]] if needed 2022-06-29 20:14:03 -03:00
David Capello
b01c28c48d Add missing override modifier 2022-06-29 20:05:58 -03:00
David Capello
7aa90db770 [lua] Add undo information in Sprite:newSlice() (fix #3393) 2022-06-29 19:46:37 -03:00
Martín Capello
c00f4b0d26 Comment m_overlap->setImmutable() to avoid crashing when moving tabs while debugging on windows 2022-06-29 15:02:21 -03:00
David Capello
72df89f917 Fix ambiguous mix of || and && in if-expression 2022-06-29 11:21:58 -03:00
David Capello
d1e08fdb2f Fix initialization order of AsepriteUpdate members 2022-06-29 11:10:18 -03:00
Martín Capello
bbbf866775 Fix name of define used in ifdefs 2022-06-28 19:16:36 -03:00
Martín Capello
627c96228b Replace use of the new operator with std::make_unique 2022-06-28 19:16:32 -03:00
Martín Capello
d63c0f7e4b Remove unnecessary DRM_CONFIGURE macro definition 2022-06-28 19:16:27 -03:00
Martín Capello
c640aee88a Add app url parameter to DRM_CONFIGURE macro 2022-06-28 19:16:24 -03:00
Martín Capello
11d6eb1d07 Include ui/timer.h 2022-06-28 19:16:19 -03:00
Martín Capello
6535defe3c Improve installation phases handling 2022-06-28 19:16:16 -03:00
Martín Capello
c764e364af Add installation thread to the update process 2022-06-28 19:16:07 -03:00
Martín Capello
7ec08ca54c Add Aseprite update dialog and fix enter license dialog 2022-06-28 19:16:03 -03:00
Martín Capello
1403424f3a Update licence activation dialog to use a new version of the DRM's license manager that doesn't emit events 2022-06-28 19:15:47 -03:00
Martín Capello
b95e402449 Remove redundant include 2022-06-28 19:15:42 -03:00
Martín Capello
854e4eb370 Add conditional compilation of code for DRM-enabled trial version 2022-06-28 19:15:34 -03:00
Martín Capello
48ffaaa378 Update CMakeLists to configure it properly when enabling DRM 2022-06-28 19:15:27 -03:00
Martín Capello
776b97deef Refactor EnterLicense dialog and add license activation handling 2022-06-28 19:13:55 -03:00
Martín Capello
2639c36b2f Create EnterLicense dialog 2022-06-28 19:09:10 -03:00
Martín Capello
588d8027f4 Conditionally compile the license activation code when the ENABLE_DRM flag is defined 2022-06-28 19:09:10 -03:00
Martín Capello
122769c836 Change the error message when the Save operation is not available 2022-06-28 19:09:10 -03:00
Martín Capello
f672193732 Fix linked libraries when ENABLE_DRM is on. 2022-06-28 19:09:10 -03:00
Martín Capello
740dd166de Refactor the code to change the "register" dialog for "enter_license" dialog 2022-06-28 19:09:10 -03:00