6466 Commits

Author SHA1 Message Date
David Capello
6341fcee23 Add missing #include to use current_editor 2021-09-01 12:02:29 -03:00
Robert Rüdiger
ac31ee35c0 Fix translucent backgrounds in color selection 2021-09-01 12:01:59 -03:00
David Capello
845f275ae7 Enable cycling colors when palette size=1 so RGB/HSV colors are converted to index=0 anyway
In this way after ChangeColor command to increase/decrease an index is
used, we always got an index selected (even index=0 if palette size=1)
2021-09-01 10:38:35 -03:00
Jeremy Behreandt
edb9f89456 Cyclic Color Change in Palettes
Made Change Color: Increment/Decrement Foreground/Background methods cyclic instead of clamped. At last palette element, incrementing selected color returns to first element. At first palette element, decrementing color returns to last element.
2021-08-31 01:10:18 -05:00
Gaspar Capello
dd2d226264 Fix crash after saving a GIF file from an indexed image which transparent index is gone
Before this fix, it was possible to lose the transparent index at Indexed Color Mode.
It was reproducible doing:
- New file, Indexed mode, Black background.
- Erase all the palette, add 40 colors slots (these all will be black)
- Press Remap button
- Go to Sprite > Properties...  set transparent color to 11.
- Erase color entries 2 to 20
- Press Remap button
You'll see the transparent index is gone (transparent index = -1)
To reproduce the crash, additional steps are needed:
- Right click to layer and select 'Layer from Background'
- Make a color RGBA(0, 0, 0, 0) and add to the palette
- Paint on canvas with this color (it'll act like a eraser)
- File > Save As... save in GIF format.
- Press OK
Crash!

This crash was reported on ticket 2620 and 2621.
2021-08-30 15:53:33 -03:00
Jeremy Behreandt
d14cf4038d Color Sort For Hue, Alpha
Removes switch case with fall through. Removes nested switch
cases. Refactors color sorting method to 1. push zero alpha colors to
the front of the palette; 2. resort to value as a criterion for gray
colors; 3. use saturation and value as back up comparisons for each
other for equivalent values; 4. approximate gamma-to-linear when
perceptual lightness is chosen.

Partial fix for #2901.
2021-08-30 15:33:53 -03:00
Joshua Ogunyinka
971ba32338 added support for loading/saving alpha channels in palette files 2021-08-30 10:57:20 -03:00
David Capello
1f6c6951af Add SetGridBounds::setGrid() to avoid some duplicated code 2021-08-30 10:52:40 -03:00
Joshua Ogunyinka
f85f24e847 fixed restoring grid preference on undo/redo (fix #2872) 2021-08-28 08:54:00 +04:00
Joshua Ogunyinka
33d0187dab Continue playing the same tag in the Preview window after switching sprites (fix #2797) 2021-08-26 08:54:29 -03:00
David Capello
d3d30ed851 Merge branch 'improve-save-performance-fseek' 2021-08-23 12:33:20 -03:00
jestarray
59e01493cb Added Duration to filename formatter 2021-08-23 11:50:28 -03:00
David Capello
4981f05f0b Fix color of the central little pixel of the crosshair 2021-08-20 20:11:51 -03:00
David Capello
2fa47b59c9 Center the "open sequence" dialog correctly when it's showed from a file specified in the CLI (fix #2899) 2021-08-18 15:36:15 -03:00
David Capello
1e98a65859 Minor change in ui::Manager::run() 2021-08-18 15:34:05 -03:00
David Capello
341408e902 Don't crash when saving palettes to .jpg format (fix #2654)
Now .jpg is not even show in the list of available format to save
palettes (same for other file format that don't support indexed color
mode).
2021-08-18 13:03:38 -03:00
Martín Capello
1eb740482e Update last row and column of pixels in the editor's viewport when the sprite is zoomed in and the color mode or FX dialog are used. (also fix #2803) 2021-08-13 11:11:55 -03:00
Alex Marcolina
54fddf7cc3 Replace fseek with putl/w to reduce io flushes
ase_file_write_start_chunk needs to skip forward the size of the chunk header, as these values will be written in later.  Using fseek was causing performance issues on my Windows machine due to causing an io flush on every chunk, for projects with many (thousands) of chunks.  Replacing with the equivalent put commands in ase_file_write_close_chunk results in ~100x speedup.
2021-08-01 20:44:15 -07:00
Martín Capello
fc79146c56 Fix crash when pressing ESC while moving a selection (fix #2829) 2021-07-16 11:24:49 -03:00
David Capello
5a6bd465f5 Cache mouse cursors to avoid re-generating them on each setCursor()
This should improve the mouse movement, where a new mouse cursor was
created on each mouse movement with black & white pixels. It's a
regression introduced in ef4f691459d13b45459c56383ab3673ca6fbec0a
(which was originally introduced to improve the mouse movement
perception in a 100Hz monitor).

This might be a possible fix for:
https://github.com/aseprite/aseprite/issues/2713
2021-07-09 10:21:16 -03:00
David Capello
8f838ba36d Backport FullscreenMode command (#464)
Original from ae02600a63a3a61713a9199ec86c701354975acf
2021-07-05 20:11:46 -03:00
David Capello
8c0215dd06 Fix UI tests 2021-07-05 19:42:32 -03:00
David Capello
95df0b23d3 Show main os::Window on the first flipDisplay() 2021-07-05 19:42:04 -03:00
David Capello
4a5a3a7bc4 Fix compilation when ENABLE_DEVMODE is defined 2021-07-05 19:41:51 -03:00
David Capello
c42c5e1453 Backport new laf API to main branch of aseprite
Some features from the beta branch of aseprite & laf were backported
to the main branch of aseprite.

Related commits:
- New memory handling (db4504e816ffccf0ea63a78737ebb6e22cc0453b)
- New get event with timeout (e6ec13cc31e6e689040bc651f98ee1752834d14c)
- Convert os::NativeCursor to an enum (06a5b4f3aebfafb6363ea33d349975d6e419ca7b)
- Adapt code to the new os::Display -> os::Window refactor (5d31314cdb23f314391e5eaebd7cea84f5179ac7)
- Save/load main window layout correctly and limit to current workarea (d6acb9e20f11fda938959c99285fe4f7d7051794)
- Redraw window immediately on "live resizing" (d0b39ebade7736d47e6b2450bf68b088c0da8e57)
2021-07-05 17:51:29 -03:00
David Capello
ffe65bface Detect webp files by file content (fix #2807) 2021-07-01 11:37:11 -03:00
David Capello
f99b5218b9 Remove unused code from ReplaceColor command
The original intention was to save selected colors in the Replace
Color dialog so then showing up it again would restore those saved
color. But it never worked in that way and just by mistake it was
using the Foreground/Background pair of colors by default (which is
the desidered behavior now). So we are just removing the buggy code
that never worked. (Related to #2028 in some way.)
2021-06-29 16:31:51 -03:00
David Capello
e73d96262d Always use Foreground color in Select > Color Range (fix #2028) 2021-06-29 16:26:48 -03:00
David Capello
78abaf0292 Minor change in MaskColor add ConfigSection constant 2021-06-29 16:23:56 -03:00
David Capello
9609d2c827 Fix crash if we press F5/reload menus when we have a menu open (fix #2496) 2021-06-28 21:13:56 -03:00
David Capello
ee7a1a1ed6 Add CompanyName field to Win32 resources file (fix #2801) 2021-06-28 12:04:56 -03:00
David Capello
6157b004e4 Fix possible memory leak setting invalid preference when loading a BoolPrefWidget from an XML file
Reported in #2782
2021-06-23 08:54:26 -03:00
David Capello
89f8e6f275 Fix possible/low chance to happen memory leak
Reported in PR #2782
2021-06-23 08:41:06 -03:00
David Capello
11e4243d05 Add ${main_target} to reference "aseprite" target 2021-06-16 17:22:31 -03:00
David Capello
74170c14fa Add ${DATA_OUTPUT_DIR} to src/CMakeLists.txt 2021-06-16 17:21:34 -03:00
David Capello
5d97aed5e9 Use new laf flags to detect platform in main and App 2021-06-16 17:21:02 -03:00
David Capello
61952bc45f Fix compilation of src/app/file_system.cpp in non-Windows platforms 2021-06-16 09:46:00 -03:00
David Capello
92c5222aa7 Use base::ComPtr in the FileSystemModule 2021-06-15 18:23:49 -03:00
David Capello
5f00e6f96a Fix possible crashes on UI menu bar/box logic (fix #2771)
We weren't able to reproduce the crash, but these checks will prevent
the crash itself. (So in the future if we receive a related report, it
will be because something is not working correctly in the menus, but
not a crash report.)
2021-06-15 15:14:17 -03:00
David Capello
37d2b62250 Convert MenuBaseData pointer to std::unique_ptr 2021-06-15 14:35:48 -03:00
Gaspar Capello
1eace24891 Improve aspect of ellipses for 16x16 or bigger sizes (fix #2217)
Now algo_ellipse() function supports additional parameters to create
rounded squares in the future.
2021-06-11 14:47:23 -03:00
David Capello
65fabf3a68 Update README/LICENSE files in src/desktop 2021-06-11 12:18:45 -03:00
David Capello
55db5ac6f2 [win] Fill the whole available space for the File Explorer thumbnail 2021-06-08 16:44:58 -03:00
David Capello
7d809bd537 Remove unused var 2021-06-07 16:14:40 -03:00
David Capello
364b121fb3 Fix some memory leaks reported by g++ 11 memory sanitizer 2021-06-07 14:19:54 -03:00
David Capello
1889e1b4a5 Don't ignore alert dialogs for fatal incompatibilities when saving
E.g. if we are going to save an indexed file as .jpg, it's a fatal
error, so we have to show the alert dialog (even when the user chose
to ignore this kind of messages warnings).
2021-06-07 13:00:01 -03:00
David Capello
f6ba8d9ae0 Allow to drag mouse outside color wheel to select colors at the circumference 2021-05-31 15:00:21 -03:00
David Capello
779bf09893 Fix color wheel radius (fix #2737) 2021-05-31 14:50:01 -03:00
David Capello
613cd38daa Set the theme of ColorButton popups correctly if they are created 2021-05-23 12:32:32 -03:00
David Capello
f4ed3ae321 Don't change user-defined pos of Splitter when we resize the window 2021-05-20 20:42:01 -03:00