Commit Graph

8778 Commits

Author SHA1 Message Date
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
02a2f1f933 Test when Sprite.events are created just when the sprite is being closed
As app 'sitechange' event is generated when we close a sprite,
accessing Sprite.events on that event will re-create the
app::script::SpriteEvents instance associated with the sprite.
2022-07-16 13:11:05 -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
David Capello
a4d730a734 Merge branch 'main' into beta 2022-07-14 15:19:41 -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
1f5d89a427 Tests for issue aseprite/aseprite#3207
Before the fix the conversion from RGB to INDEXED color mode, in
transparent layers, always picked index 0 as transparent color, even
if the mask color was present in the palette.
2022-07-14 14:35:34 -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
51132a8e84 Update laf submodule 2022-07-14 14:16:24 -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
7ca66790c5 [win] Fix rounded corners on Windows 11 when some windows appear for first time 2022-07-10 22:22:57 -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
59c6c06fa0 Add missing libc++abi-10-dev dependency on Linux (#3382) 2022-07-03 12:41:02 -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
David Capello
a03ff2280a Test undo of Sprite:newSlice()
Related to https://github.com/aseprite/aseprite/issues/3393
2022-06-29 19:45:05 -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
6bd7518aea Merge branch 'drm' into beta 2022-06-29 11:45:30 -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
David Capello
8cccad4472 Avoid warnings about URLs in enter_license.xml dialog 2022-06-29 10:58:51 -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