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.
* 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.
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.
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%
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.
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.
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>
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.
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.