1
0
mirror of https://github.com/aseprite/aseprite.git synced 2025-02-16 15:40:20 +00:00

9904 Commits

Author SHA1 Message Date
David Capello
3d683ac6aa Minor layout change in Color Mode dialog (from vbox to grid) 2024-09-03 18:15:29 -03:00
Gaspar Capello
e1bd7990a3 Add color fit criteria for Color Mode conversion (fix , )
Added other color comparison criterias (fit criteria) during
color mode conversion RGBA to Indexed or Grayscale to Indexed.
The 'fit criteria' will help us to recolor an RGB image with
a limited color palette taking into account different color
perception criteria (color spaces: RGB, linearized RGB,
CIE XYZ, CIE LAB).
2024-09-03 13:17:09 -03:00
Gaspar Capello
3cc1c63274 Add different best fit criteria to compare colors for RgbMaps (fix , ) 2024-09-03 13:17:06 -03:00
Gaspar Capello
e12233a19d Tests for new function make_aligned_mask 2024-09-03 11:44:25 -03:00
Gaspar Capello
68730c1c1b [lua] Add get/set 'tilemapMode' Site object 2024-09-03 11:44:25 -03:00
Gaspar Capello
95513af267 Fix multiple tileset layers selection move is broken (fix )
Before this fix, a multi-layer mask movement/scaling (with mixed layer
types: normal layer and tilemap layers with different grids) caused
loss of drawing areas.

The heart of this solution is to correctly align the 'selection mask'
and 'transform data' according to the layer's grid, and also, forcing
'site' TilemapMode/TilesetMode before each
reproduceAllTransformationsWithInnerCmds() iteration.
During the life of a PixelMovement object there is a tilemap mode lock.

Additionally arrow keys now work to move a selected area in
TilemapMode::Tiles.
2024-09-03 11:44:25 -03:00
David Capello
a21f0888ad Merge branch 'main' into beta 2024-09-03 11:26:23 -03:00
David Capello
bf0a47545c Remove #if/endif ENABLE_UI conditional directives (fix )
This was originated for  (CLI-only Aseprite) which can be
achieved with LAF_BACKEND=none anyway.

In this way we simplify the development process, and checking for the
availability of the GUI can be done in run-time through App::isGui()
or Context::isUIAvailable().
2024-09-02 23:16:26 -03:00
David Capello
c4526cf709 Remove ENABLE_UI option ()
Now we use the LAF_BACKEND=none/skia to detect if it's going to be the
CLI/GUI version of the program. The ENABLE_UI flag is still defined at
compile-time just to avoid removing all #ifdef/endif conditional
directives right now.
2024-09-02 18:17:23 -03:00
David Capello
fea3f5fcee Fix English strings considering some comments from Weblate
Comments:
https://hosted.weblate.org/translate/aseprite/aseprite/en/?checksum=10ed5b5794156584#comments
https://hosted.weblate.org/translate/aseprite/aseprite/en/?checksum=a866d26f91d1f329#comments
https://hosted.weblate.org/translate/aseprite/aseprite/en/?checksum=df163b02578e8c01#comments
https://hosted.weblate.org/translate/aseprite/aseprite/en/?checksum=b23f6bf0b6dcbce4#comments
https://hosted.weblate.org/translate/aseprite/aseprite/en/?checksum=1b58980af2aa6bd0#comments
2024-08-30 14:15:30 -03:00
Christian Kaiser
c554f07d28 Adjust strings for clarity/correctness 2024-08-30 13:42:57 -03:00
Martín Capello
75da9c6c51 Revert select_layer_boundaries behavior
select_layer_boundaries was affected by a change made to Mask::fromImage
where a hardcoded threshold was changed from 128 to 0. To make
select_layer_boundaries behave as before, I've added a new parameter to
Mask::fromImage to set the threshold and then use the same hardcoded
value it was using (128)
2024-08-29 15:25:46 -03:00
Martín Capello
55042f89ce Updated copyright date 2024-08-29 15:25:46 -03:00
Martín Capello
8e904761f1 Keep 9-slice borders fixed while scaling bounds
Scaling 9-slice bounds will keep the border size (determined by the
sub-slices surrounding the center sub-slice) fixed.
2024-08-29 15:25:46 -03:00
Martín Capello
d88c22386d Set default tilemap and tileset modes
When layers of different kinds (tilemap and image) are selected set the
default modes when the last selected layer is image type.
2024-08-29 15:25:37 -03:00
Martín Capello
e7f308bbfe Fix fromImage() to avoid missing pixels
Before this, pixels with an alpha < 128 were not taken into account to
build the mask. Now only pixels with alpha = 0 are not taken into
account.
2024-08-29 15:25:37 -03:00
Martín Capello
4f6b997101 Fix indentation and includes order 2024-08-29 15:25:37 -03:00
Martín Capello
777715a56f Avoid clearing slice from a layer with no cel 2024-08-29 15:25:37 -03:00
Martín Capello
0d5ecf3c02 Add some comments 2024-08-29 15:25:37 -03:00
Martín Capello
0c336d8f09 Avoid calculating selected layers when not needed 2024-08-29 15:25:37 -03:00
Martín Capello
23160a9fee Fix slice transform undo after making a cel empty 2024-08-29 15:25:37 -03:00
Martín Capello
2c58669909 Cleanup headers 2024-08-29 15:25:37 -03:00
Martín Capello
fb74feea21 Add 9-slice transformation support 2024-08-29 15:25:35 -03:00
Martín Capello
ca75a98679 Add support to TilemapMode::Tiles mode
When transforming slices in a tilemap layer while Tiles mode is active
2024-08-29 15:24:48 -03:00
Martín Capello
f5baba389b Replace StampInCel command by ExpandCelCanvas
This avoids duplicating logic and reuse an existent command
2024-08-29 15:24:48 -03:00
Martín Capello
7dc01bcdf7 Fix initial state of transform checkbox 2024-08-29 15:24:48 -03:00
Martín Capello
22a4344b14 Try specific logic to transform slices contents
Instead of trying to reuse the PixelsMovement class we create new
commands and logic to handle the slices content transformation
2024-08-29 15:24:48 -03:00
Martín Capello
159b5efa29 Add new_image_from_mask() function variant
This new variant returns an image from a specific layer's frame.
Also a copy_masked_zones() function was created to contain with the
common code for the new_image_from_mask variants
2024-08-29 15:24:48 -03:00
Martín Capello
66af5a7db1 Create Mask::fromImage method
Moved code from select_layer_boundaries to this new
Mask's method to create a mask from an image
2024-08-29 15:24:48 -03:00
Martín Capello
073a1d8794 Move code from StandByState to MovingSliceState 2024-08-29 15:24:48 -03:00
Martín Capello
80afafa45a Use std::move to avoid unnecessary copies 2024-08-29 15:24:48 -03:00
Martín Capello
ead2023cfd Add "Transform" checkbox to slices and introduce moving slice content 2024-08-29 15:24:48 -03:00
Gaspar Capello
8323a55500 Fix Cancel command do not work on scripting
Before this fix, the 'Cancel' command did not work in the following
specific situation:
As soon as Aseprite was started and without hitting the 'Esc' key,
the 'app.command.Cancel()' command did not perform any operation.

It was discovered that the Cancel command is started only once per
session and retains the 'm_type' throughout the session. Only
a specific:
app.command.Cancel {type = "all"} or
app.command.Cancel {type = "noop"}
could change the command type.
2024-08-29 10:50:03 -03:00
دانتي باولا
dd208ebe5d
Use right click action with shading ink (fix ) () 2024-08-29 10:45:52 -03:00
David Capello
f9d2f1ce46 Remove Graphics::measureUIText/Length() functions
With the introduction of Widget::processMnemonicFromText() in
17151cddcd25ab089f5d2ffcc9ec680ba6cd57bf we don't require these
functions anymore because the '&' character isn't not present in the
widget text (so we can just measure the text length as usual).

This was discovered in PR :
https://github.com/aseprite/aseprite/pull/4604#discussion_r1731172284
2024-08-28 15:22:51 -03:00
David Capello
7941b5d971 Merge branch 'new-text-tool' into beta (fix ) 2024-08-27 16:38:56 -03:00
David Capello
d3a55867c2 Resize text box when more space is needed (more text or bigger font) 2024-08-27 16:18:54 -03:00
David Capello
49afc0dd52 Add support to move the text box when we drag it from the edges 2024-08-27 16:18:50 -03:00
David Capello
241746d04b One click opens a new box to write text with a default size 2024-08-26 18:28:48 -03:00
David Capello
8fa4775def Persist the text selection when we change the font 2024-08-26 18:21:13 -03:00
David Capello
08de330123 Redraw text editor immediately after changing anti-alias option 2024-08-26 18:07:13 -03:00
David Capello
7558504733 Fix caret/highlight positions when we change the font 2024-08-26 18:07:13 -03:00
David Capello
5a877f49e4 Fix caret position in ui::Entry
We have to fill/use the X position of each char box instead of
calculating it through the width of each glyph (because each advance
is different from the glyph width in isolation).
2024-08-26 18:07:08 -03:00
David Capello
ae1d9ca9b1 Render text/highlight selected text on the canvas
Now we don't render the default ui::Entry edges, but we paint just a
border of the text bounds + the rendered text highlighting selected
text on the canvas itself.

With this change click mouse positions are translated with a scale
factor that changes depending on the app::Editor zoom.
2024-08-26 11:47:57 -03:00
David Capello
0bf9353a02 Add new Text tool (fix )
This is the first (not yet production-ready) version of the
interactive Text tool. The text input is done with a transparent
ui::Entry, and on each text modification an ExtraCel is rendered with
this same ui::Entry's TextBlob to be displayed in the canvas with the
active zoom level.

The ui::Entry is being painted along the text in the canvas (just for
testing), but this is something to be fixed. Probably it will not be
the case in the future and a fully customized rendering (onPaint())
process will be required.
2024-08-26 11:47:57 -03:00
David Capello
ae091726fe Fix FontInfo tests 2024-08-26 11:47:57 -03:00
David Capello
cf67842760 Fix text bounds using shaped text w/the font of each text run
This fixes the required output image size to render text in different
languages when the text doesn't support the full range of the
specified chars/code points, and multiple fonts/text runs are used.
2024-08-26 11:47:57 -03:00
David Capello
bc63d2f660 Fix bug ignoring bold/italic after we click another font name
If we clicked bold/italic, and then chose another font family, we were
using the cached typeface inside the FontInfo instead of an update
typeface with the selected styles applied (bold/italic).

Now we don't cache the typeface inside FontInfo to avoid this.
2024-08-26 11:47:57 -03:00
David Capello
53f045a369 Add Bold/Italic buttons to select a font 2024-08-26 11:47:57 -03:00
David Capello
455a67111a Use the most regular/normal typeface style for preview purposes 2024-08-26 11:47:57 -03:00