Commit Graph

6969 Commits

Author SHA1 Message Date
David Capello
926accf7c7 Split layers/tags explicitly on export sprite sheet when the options to split layers/tags are used
This is mainly useful when we want to include the "{tag}" in the JSON
data but we don't want to split tags in the sprite sheet
layout (e.g. using a fixed # of rows in "By Rows" sprite sheet type
without breaking rows when the tag change between a couple of
samples).
2019-10-24 08:55:11 -03:00
David Capello
446e7055e9 Fix MSVC compilation of libarchive: Don't use /WX (-Werror) 2019-10-23 21:10:19 -03:00
David Capello
13d042f346 Add options to merge duplicates/ignore empty cels in Export Sprite Sheet 2019-10-23 21:09:56 -03:00
David Capello
0a2d5e171b Fix crash previewing Export Sprite Sheet in certain cases 2019-10-23 20:15:09 -03:00
David Capello
d6efddee92 Cache trimmed bounds calculation on DocExporter
The cache of the whole sprite trimmed bounds makes sense only in the
UI preview mode.
2019-10-23 15:55:08 -03:00
David Capello
c228b36699 Update laf module 2019-10-23 14:51:22 -03:00
David Capello
a0b389e87a Delete old cel of previewed sprite sheet ASAP 2019-10-23 14:51:08 -03:00
David Capello
258f85aafb "horizontal" must be the default sprite sheet type (as in old versions) 2019-10-23 14:49:28 -03:00
David Capello
b6fce0b1df Print to stdout from DocExporter only in CLI mode 2019-10-23 14:48:18 -03:00
David Capello
450742af4b Remove unused getters from DocExporter class 2019-10-23 14:48:05 -03:00
David Capello
cd68a4fe0a Add "Trim Sprite" to DocExporter/Export Sprite Sheet/--trim-sprite CLI 2019-10-22 21:27:15 -03:00
David Capello
f375ced883 Fix loading tooltips for comboboxes 2019-10-22 20:31:06 -03:00
Gaspar Capello
398daf14db Fix Flatten Visible crash when no layers are visible
Bug founded by Jerry Pie from Steam
https://steamcommunity.com/app/431730/discussions/0/1606022547906751802/
2019-10-22 19:22:43 -03:00
Gaspar Capello
558943ebec Fix Set Ink Type command crash when it is executed without UI 2019-10-22 19:20:49 -03:00
David Capello
66ccf51eb9 Move the logic to get the refColor for trimming to app::get_best_refcolor_for_trimming() function 2019-10-22 19:19:42 -03:00
Gaspar Capello
695d85e566 Fix Trim command when top-left corner is non-transparent (fix #1659) 2019-10-20 12:00:29 -03:00
David Capello
536a4c5d3a Simplify Export Sprite Sheet with preview + changes to the UI
These changes include an option to split layers and tags
by rows (fix #1118)
2019-10-18 17:00:35 -03:00
Gaspar Capello
7fd1c7e0e7 Add ink type Copy Alpha+Color to custom brush 2019-10-15 10:06:42 -03:00
Gaspar Capello
7160f45296 Fix Custom brushes + Pen + Shading Ink breaks pattern alignment (fix #1615)
Add specialization of shadingProcessPixel for each ImageTraits.
Additionally, to avoid code repetition, we reuse ShadingInkProcessing
functions to process the new added BrushShadingInkProcessing. To
accomplish it, we did nest a code portion from original
ShadingInkProcess::processPixel(). This code portion was named:
shadingProcessPixel(...)
2019-10-15 09:59:15 -03:00
David Capello
8689daa4b8 Update libarchive module 2019-10-10 21:27:58 -03:00
David Capello
30b2585037 Save grid bounds inside .aseprite files and doc::Sprite (fix #688) 2019-10-10 15:08:59 -03:00
David Capello
86ef6979e2 Remove undefined function from app::cmd::SetPixelRatio 2019-10-09 15:44:52 -03:00
David Capello
9e45934c6e Remove "using namespace doc" from app/cmd/with_sprite.h
We should remove all "using namespace" from header files, but it's a
progressive thing to do/not critical.
2019-10-09 15:43:06 -03:00
David Capello
aa66ff35a2 Refactor DocExporter::DataFormat -> SpriteSheetDataFormat 2019-10-07 17:22:27 -03:00
David Capello
fa246d9c60 Add Packed style to File > Export Sprite Sheet 2019-10-04 15:22:58 -03:00
Gaspar Capello
2b1be4f288 Fix custom brush is available with the eraser tool (fix #1408) 2019-10-04 15:05:02 -03:00
David Capello
d99e642c55 Add split layers option in ExportSpriteSheet 2019-10-03 15:52:19 -03:00
David Capello
7a10139a87 Minor refactor in ExportSpriteSheet adding functions to update params from window widgets and update DocExporter from params 2019-10-03 10:08:46 -03:00
Gaspar Capello
b533e77b3f Fix export sprite sheet rows and columns calculation and others
Several things are changed to fix columns and rows calculation in de Export Sprite Sheet Dialog.
- onSizeChange() Conditions were added to consider padding and sprite sheet type in columns and rows calculation.
- onSheetTypeChange() Condition was added to consider best_fit mode, and consequent  columns and rows calculation.
 - On ExportSpriteSheetWindow creation, unnecessary conditions and onSizeChange execution were removed. Because, we need update columns, rows, fitWith and fitHeight according the current sprite data (done in onColumnsChange()), instead of the saved params.
- best_fit() function: type sprite sheet argument was added  to fix columns and rows calculation when Columns type sprite sheet is selected in best fit mode.
- best_fit() function: it was simplified by removing the “for” iterations since they were unnecessary. We found a simpler way to do that.
- best_fit() function: it have no longer gfx::Region and gfx::Rect variables, because, the calculation is simpler now.
- MID macros were replaced by base::clamp() function.
2019-10-02 17:03:42 -03:00
David Capello
8eed8b8a5e Update laf (minor fix to show invalid arguments in -full-form) 2019-10-02 13:00:17 -03:00
David Capello
51be644bf4 Merge duplicated samples when -sheet-pack is used (fix #1316) 2019-10-02 12:55:09 -03:00
David Capello
01821ed989 Don't discard empty frames if the cel is empty but the user doesn't want to discard empty frames (fix #2116)
E.g. Useful to match frames with tags information.
2019-10-01 20:39:02 -03:00
David Capello
1c8b8051a8 Rename FrameTag -> Tag 2019-10-01 14:55:08 -03:00
David Capello
c25c67733b Include ui/scroll_helper.h in ui/ui.h 2019-10-01 14:35:47 -03:00
David Capello
4e4cafece6 Rename FrameTags -> Tags in file spec/encoder/decoder functions 2019-10-01 13:16:35 -03:00
David Capello
cefeb9cbc0 Make "Duplicate Cels" commands behave like the timeline range is enabled even for the case of one cel
In this way we can use Alt+D to duplicate the active cel, and Alt+M to
link the active cel in the next frame.
2019-10-01 12:05:04 -03:00
David Capello
b6fceaf549 Keep the transparent color index on the output of Export Sprite Sheet 2019-10-01 10:08:07 -03:00
David Capello
5e25d5a021 [lua] Add support to call AddColor from scripts 2019-10-01 09:37:04 -03:00
David Capello
944634542e Refresh screen/current palette automatically on Transaction::commit() (#378)
Removed app_update_current_palette() with this patch.
2019-10-01 09:24:03 -03:00
Gaspar Capello
7c92fe207a Fix caret position when click on a text entry (#2160) 2019-09-30 16:22:01 -03:00
David Capello
b4c0a032e8 Fix previous commit 2019-09-27 17:48:51 -03:00
David Capello
46de0c95c3 Preserve links when moving cels to different layer (continuation of 75636afd64) 2019-09-27 14:37:19 -03:00
Gaspar Capello
3e1fe9771a Add LockAlpha ink type to Brush Ink (#2133)
Now we can use LockAlpha ink type with Image Brush.
In addition, we defined Simple ink type with Image Brush.
2019-09-26 19:21:25 -03:00
David Capello
75636afd64 Preserve cel links when we copy/move a range of cels/frames
This is a common solution in the DocApi wrapper that takes cares of
the duplicated cels that we're copying with copyCel() and that are
linked in the source, so then it maps the links into the destination.
Solving this in DocApi we fixed the problem on the timeline
drag-and-drop (doc_range_ops), copy/paste clipboard ranges, and merged
the code in NewFrame to duplicate (linked) cels.

We've also added 3 variants of Duplicate Cels with this change:
- Duplicate Cels: Copies the whole cel block without linking to
  previous cels.
- Duplicate Linked Cels: Copies the whole cel block linking all cels to
  previous cels.
- Duplicate Cels w/Layer Mode: Depending on the layer mode (continuous
  or not) the cels will be linked or not (this is how "duplicate
  linked cels" was working before, and was added just in case for
  backward compatibility).

Fixes: http://steamcommunity.com/app/431730/discussions/1/142261352649813598/
2019-09-26 19:09:23 -03:00
David Capello
4ff77a4d55 Fix auto-pick of layers when alpha in 1...127 range (fix #2156)
The threshold of 50% was chosen to select layers that are more visible
than others (whatever is the order of layers in the stack) but it
might not be working as expected (e.g. if both composed layers has
alpha < 128 it will select no layer at all). Maybe in the we could
choose a higher threshold than 1, but let's see how it works for
users.
2019-09-26 11:51:15 -03:00
David Capello
6adbf899d4 Fix progress bar applying filters (fix #2152, related to 1659401642)
Regression introduced in 4264f199cd
2019-09-25 14:33:56 -03:00
David Capello
f4bf7a22a3 Update laf module 2019-09-24 17:08:34 -03:00
David Capello
1659401642 Fix progress bar applying filters (fix #2152)
Regression introduced in 4264f199cd
2019-09-24 15:57:26 -03:00
David Capello
ccb9dc6f25 Add missing PngOptions (related to a532f21ec4, #2153) 2019-09-24 09:59:22 -03:00
David Capello
8d5133fe09 Move editor_type() -> Editor::Type() 2019-09-23 20:02:19 -03:00