Commit Graph

10293 Commits

Author SHA1 Message Date
David Capello bae8520580 Update modules due cmake_minimum_required() issues (#5087, #5071) 2025-04-02 21:44:03 -03:00
David Capello 7167969963 [theme] Fix horizontal separator alignment 2025-04-02 09:32:34 -03:00
David Capello 537ccd393f Prevent polling keyboard state for each created ui::Message
Getting the keyboard state to fill the keyboard modifiers can be
expensive (mainly on Windows calling GetAsyncKeyState). So we can lazy
evaluate the modifiers when they are needed.
2025-04-02 08:00:11 -03:00
Christian Kaiser b130601716
Startup optimizations (#5090)
* Delay DitheringSelector startup
* Delay setting the drag target
* Delay & enqueue menu reloading
2025-04-02 07:59:52 -03:00
David Capello 816be744ac Add Widget::textBaseline() to fix several misalignments using scalable fonts
* Each widget can customize its text baseline (onGetTextBaseline()) to
  know where to draw text when it's vertically aligned to the middle
  (now more correctly "aligned to the baseline").
* Add PAINT_BASELINE to test where the baseline is on each widget.
* "Aseprite" and "Aseprite Mini" fonts now have a special
  descent/ascent configuration with a specific baseline position.
2025-03-27 18:22:51 -03:00
David Capello 50bccf85fc Add support to scale sprite sheet fonts
We've highlighted (with an "*") the sprite sheet font size, so it's
easy to select its default size.
2025-03-24 23:19:30 -03:00
David Capello 2ee4819bf9 Show link to go to the Themes section to customize the font for certain languages 2025-03-14 16:02:31 -03:00
David Capello 805d98e943 Fix font rendering issues in non-English languages (fix #4804)
Graphics::measureText() wasn't shaping text correctly using the
FontMgr to get more fonts when they were required. And now
SkinTheme::drawText() can use Widget::textSize() (the cached size of
the widget text blob) to calculate the required text size.
2025-03-13 16:20:11 -03:00
Martín Capello c68b4923f8 Prevent using an invalid drawing point (fix #5055) 2025-03-12 15:47:23 -03:00
David Capello 53c415c933 Fix entry height in ColorSliders when UI Scaling > 100% 2025-03-10 10:02:14 -03:00
David Capello d3265a1711 Fix UI vs Screen Scaling bugs w/window buttons and button sets/grids (fix #5043)
Includes:
* New ui::Style::rawMargin/Border/Padding() to detect what values are
  undefined, and ui::Style::margin/border/padding() to return normalized
  values (replacing kUndefinedSide with 0 when a value is not defined in
  the whole hierarchy of styles). With this change we avoid using a
  margin/border/padding value of -1 by mistake.
* New guiscaled_div() to calculate an integer division taking care the
  guiscale() for a scaled value.
* CALC_FOR_CENTER() renamed to guiscaled_center() and moved to ui/scale.h

There are still a lot of work to be done to fully fix these UI issues
between Screen Scaling=200%/UI Scaling=100% vs Screen Scaling=100%/UI
Scaling=200%
2025-03-09 22:01:55 -03:00
David Capello c949f4a5a6 Centralize defined fonts in new app::Fonts class 2025-03-04 13:54:15 -03:00
David Capello 2706d2d75a Move font related types to src/app/fonts 2025-03-03 22:36:11 -03:00
David Capello ce989684d0 Don't save custom theme fonts when we uncheck these options 2025-03-03 21:48:47 -03:00
David Capello da5909639b Use the new Surface::applyScale() 2025-03-03 16:42:03 -03:00
David Capello fc63532fef Ignore .vscode directory 2025-03-03 11:24:52 -03:00
David Capello be6d2251aa Merge branch 'main' into beta 2025-02-26 10:26:09 -03:00
David Capello 9378f44191 Show warning when raw cel format for .aseprite files is selected (#4901, #4951) 2025-02-26 10:22:36 -03:00
David Capello f7f93c64f2 [lua] Update scripting API version to 32 2025-02-26 09:38:31 -03:00
David Capello 28d31a0b41 Change background color of read-only ui::Entry fields 2025-02-26 09:13:38 -03:00
David Capello 1e96c4640f Fix indentation of layer UUID in Aseprite file format spec 2025-02-26 08:36:35 -03:00
Gaspar Capello e4b3981ca6 Fix when Slices are set to a semi-transparent color they become opaque as we draw. 2025-02-25 15:10:41 -03:00
Liebranca ed56011a0f Fix set_sat() blend function 2025-02-25 10:22:48 -03:00
lightovernight ad765723c9 Fix Straight line via SHIFT + Tiled mode starts at wrong position 2025-02-25 09:46:31 -03:00
Gaspar Capello 63f918cf2a Fix onionskin visiblity is not updated if cel is empty (fix #4969) 2025-02-24 22:11:15 -03:00
Gaspar Capello e17c3400fb Fix "Straight Line from Last Point” bug in Tilemaps (fix #4623)
Prior to this fix, when the following conditions were met:
- On a tilemap layer
- Tilemap mode = OFF
- Tool = Pencil
- Tileset mode = Manual
- Modifying an existing tile with the "quick line"
  (i.e. holding down the SHIFT key)
resulted in incorrect tool behavior.
2025-02-24 21:56:36 -03:00
Martín Capello fa3fd501e0 Read and write layer's uuid as last element 2025-02-24 16:36:39 -03:00
Martín Capello 6580580e4e Replace <iostream> by <iosfwd> 2025-02-24 15:14:20 -03:00
Martín Capello 7454ec2d06 Rename m_useUuidsForLayers by m_uuidsForLayers 2025-02-24 15:14:14 -03:00
Martín Capello 9e69df53d1 Add assert when setting a layer's UUID 2025-02-24 14:58:28 -03:00
Martín Capello efc2a308b2 Fix includes order 2025-02-24 11:27:05 -03:00
Martín Capello dd644865cb Fix m_uuid field's comment 2025-02-24 11:23:39 -03:00
Martín Capello 7a03e45475 Generate UUIDs for Layers lazily 2025-02-24 11:12:54 -03:00
Martín Capello d398bd7a2a Replace "" by std::string() 2025-02-24 10:48:55 -03:00
Martín Capello 2071e465a1 Replace label by entry to show the layer's UUID 2025-02-24 10:47:24 -03:00
Martín Capello 7ced9af5d1 Reword some "UUIDs for layers" related text 2025-02-24 10:47:17 -03:00
Martín Capello c3cfae666b Add io part for layers UUIDs 2025-02-24 10:14:33 -03:00
Martín Capello 86ad09291f Add UUIDs to layers 2025-02-24 10:10:28 -03:00
David Capello 5739bfe287 Fix crash canceling "Apply" filter and then using "OK"
This fixes the ASSERT(!m_tx) in FilterManagerImpl::initTransaction()
in Debug mode, and a crash in Release that happens in any filter if we
cancel a filter progress in the middle, and then press the "OK"
button.
2025-02-20 12:23:31 -03:00
Gaspar Capello f2b870a17f Fix image:drawImage+BlendMode.SRC doesn't draw mask pixels (fix #5001)
Also added tests for Image:drawImage + BlendMode::SRC + ColorMode.RGBA
2025-02-20 12:14:04 -03:00
David Capello 919f4f3321 Update laf module 2025-02-19 17:35:13 -03:00
David Capello a4e0636c9f [lua] don't allow to set invalid pixel ratios (fix #3285) 2025-02-19 17:19:27 -03:00
Gaspar Capello 26f6a210b6 Fix crash with custom pixel ratios (e.g. Size(4, 3)) (fix #4632)
Prior this fix some custom pixel ratios + old render engine +
zoom level <= 50% resulted in crashes.
2025-02-19 15:47:16 -03:00
David Capello b7967a078e Select the default theme font when clicking custom font check boxes 2025-02-15 13:04:49 -03:00
David Capello 698c581c39 Fix FontEntry/::FontFace (SearchEntry) look when it's disabled 2025-02-15 12:58:25 -03:00
David Capello d4406629e6 Add possibility to customize theme fonts (#712, #4307)
From Edit > Preferences > Themes we now can customize the theme Font
and Mini Font.
2025-02-15 12:58:25 -03:00
David Capello bc3433fcf2 Add new ui::TranslationDelegate to translate Entry popup items
Parts of this commit are from #4968 and will be useful to reuse in the
multiline TextEdit widget.

Co-authored-by: Christian Kaiser <info@ckaiser.com.ar>
2025-02-15 12:09:37 -03:00
Martín Capello 2e6d6cfb14 Avoid delayed filter preview start after stop 2025-02-12 17:17:01 -03:00
David Capello d5738fb492 Avoid capturing the mouse from widgets in background windows
This avoids clicking buttons that are not in the foreground/modal
window. At the same time the onBroadcastMouseMessage() functionality
was expanded in such a way that added widgets to the broadcast are the
only ones allowed to re-capture the mouse (even if they are not in the
current foreground window). This is required so the Editor can be
scrolled when we are visualizing a Filter window with preview.

New functions added to simplify some code:

* Manager::transferAsMouseDownMessage()
* Manager::allowCapture()
* base::contains()

Related to #4963 and #4973.
2025-02-12 11:01:59 -03:00
Gaspar Capello 3e3dd2a653 Fix timeline thumbnail zoom can't scale beyond 1:1 pixels (fix #4974)
Prior this fix when using large thumbnail sizes on the timeline with
smaller cel images, instead of enlarging the thumbnail image to fit
the full area available, it just adds transparent whitespace around
the thumbnail image.
2025-02-11 11:06:23 -03:00