Commit Graph

10036 Commits

Author SHA1 Message Date
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 #4520) (#4615) 2024-08-29 10:45:52 -03:00
David Capello f9d2f1ce46 Remove Graphics::measureUIText/Length() functions
With the introduction of Widget::processMnemonicFromText() in
17151cddcd 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 #4604:
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 #28) 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 #28)
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
David Capello cf514f0c53 New font selector (fix #4363)
This new font selector list installed fonts with its proper name. It
still needs some extra work to select font set styles (regular, bold,
italic, etc.)
2024-08-26 11:47:57 -03:00
David Capello 1d9f14665f New ui::FocusMessage with oldFocus/newFocus fields 2024-08-26 11:47:57 -03:00
David Capello 73b23c3830 Update laf module 2024-08-26 11:47:29 -03:00
Christian Kaiser 7d80ff120c Fix news not parsing correctly 2024-08-26 10:00:11 -03:00
Christian Kaiser aed9127b51 Avoid drawing empty strings 2024-08-26 10:00:11 -03:00
David Capello 1c1c4593ed Merge branch 'main' into beta 2024-08-22 14:26:18 -03:00
David Capello e87f6df72b Avoid loading current dithering matrix on each mouse move (related to #4174)
With this change we are reusing the cached/loaded matrix on each
DitheringMatrixInfo struct, calling the
load_dithering_matrix_from_sprite() function just one time (not on
each brush preview/mouse movement).
2024-08-21 19:49:55 -03:00
David Capello 29479cb231 [win] Fix saving files to network paths (fix #4608) 2024-08-21 18:38:17 -03:00
David Capello 7b24cf2594 Fix "New Frame" button for existing third-party themes (fix #4609)
We made an attempt to change the "+" character with an icon, but we
cannot use an existing style to do this kind of change in themes (as
third-party themes will be using the old version of the style, not the
updated one).

We're reverting part of the change introduced in
e0ff51947a to use the "+" character for
this "New Frame" button in the status bar.
2024-08-21 16:55:11 -03:00
David Capello 1ca4306f9d [win] Fix File > Export > Export As to other drive (fix #4607)
This only affects the Windows platform.
Regression introduced in db639072f7
2024-08-21 13:50:29 -03:00
David Capello 8817724e44 Fix typo using ENABLE_I18N_STRINGS var 2024-08-19 20:08:56 -03:00
Martín Capello 712d84e44e
Avoid div by zero by preventing entering/returning a grid bounds w/zero width/height (fix #4146, #4597) 2024-08-19 18:07:40 -03:00
Christian Kaiser 4df11ac1e3
Reset mask when clicking outside of bounds with the magic wand tool (fix #4490, #4595) 2024-08-15 09:13:18 -03:00
David Capello e5c9ab40db Fix label background of guides when moving cels 2024-08-12 20:16:11 -03:00
Panagiotis Georgiadis 0bdcdbfc49 [docs] Improve phrasing for Tileset image data length
Clarified the description for the data length field of the
compressed Tileset image when flag 2 is set.
2024-08-12 17:22:05 -03:00
David Capello 68d5262c48 Merge branch 'main' into beta 2024-08-09 21:06:57 -03:00
David Capello d6436647ab Update laf module 2024-08-09 20:51:28 -03:00
Siddhant Madhur 3c876066aa Fix indentation in INSTALL.md
In the MacOS (Apple Silicon) install commands,
"ninja aseprite" was incorrectly indented.
2024-08-09 11:05:17 -03:00