9673 Commits

Author SHA1 Message Date
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
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 #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).
v1.3.8.1
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
e0ff51947a94bb20383f3fc501eb3e749c258728 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 db639072f77daf724f9eeb0642d7de61924db973
2024-08-21 13:50:29 -03:00
David Capello
8817724e44 Fix typo using ENABLE_I18N_STRINGS var v1.3.8 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
David Capello
4e5dfa9d2c Don't export cel opacity when it's 255 (#4511 / #4552)
In this way we don't modify the current exported JSONs by users that
are not using cel opacity (which might be the most common case).
2024-08-08 19:02:51 -03:00
requizm
a11946ab0e Added opacity field when exporting a cell 2024-08-08 18:57:30 -03:00
Christian Kaiser
e0ff51947a
Add new frame menu to status bar button (#4582) 2024-08-08 17:23:41 -03:00
Gabe Spound
99f1a1ea06 Needed libwebP as a dependency on Arch Linux 2024-08-08 16:51:29 -03:00
David Capello
657e679461 Some extra comments to the coding style guide 2024-08-08 16:17:56 -03:00
David Capello
fcbd50e46f Remove emoji from contributing guide (but don't forget to smile) 2024-08-08 16:13:35 -03:00
David Capello
6f65acb54f Add VS 2022 command prompt from Start menu in INSTALL guide 2024-07-29 17:31:03 -03:00
Gaspar Capello
8f3af748b9
Don't allow to install third-party themes that override the default one (fix #4226) (#4335)
This 1) hides user themes whose name is the same as the default,
and are present in the user folders (i.e.  'extensions' and
'data/themes' folders), and 2) doesn't allow to install themes with
the same content/ID of the default aseprite-theme (fix #4226)
2024-07-29 16:02:05 -03:00
requizm
b65fb3a14e Fixed size calculation on resize_image 2024-07-25 17:59:31 -03:00
David Capello
26279597b6 Add help button "?" in some windows (fix #1980)
We hope to enhance the discoverability of Aseprite features in this
way.
2024-07-25 16:02:21 -03:00
David Capello
3c44831831 We can use = {} for default arg values in function declarations 2024-07-19 17:10:39 -03:00
David Capello
9da10605d3 Remove duplicate code with new sort_slices_by_name() function 2024-07-19 16:47:13 -03:00
requizm
6047ab69de [ui] Fixed slice order in File > Export > Export As > Area 2024-07-04 14:22:51 -03:00