https://bugs.kde.org/show_bug.cgi?id=457675

Nate Graham <n...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Version Fixed In|                            |5.98
      Latest Commit|                            |https://invent.kde.org/fram
                   |                            |eworks/kirigami/commit/2676
                   |                            |403e803d84e4963fa4e5f377901
                   |                            |2e001bf24
         Resolution|---                         |FIXED
             Status|CONFIRMED                   |RESOLVED

--- Comment #9 from Nate Graham <n...@kde.org> ---
Git commit 2676403e803d84e4963fa4e5f3779012e001bf24 by Nate Graham, on behalf
of Connor Carney.
Committed on 16/08/2022 at 16:01.
Pushed by ngraham into branch 'master'.

FormLayout: Explicitly round up implicit sizes

The implicit size of an item may not be an integral number of pixels.
GridLayout internally `ceil`s the implicitHeight and implicitWidth 
properties, but not the Layout.* attached properties, so we need to 
call Math.ceil ourselves whenever we set a Layout property based on the 
implicit size.

If a non-integral layout parameter has a fractional part <0.5 then the 
layout engine will end up rounding it down to a pixel-aligned value that 
is not quite large enough to fit the contents (see included test case).

For word-wrapped text, the slightly-too-small size causes the text to
inappropriately wrap. If the implicit size of the wrapped text gets 
rounded differently it causes an infinite loop in the layout.

This changes the behavior of existing clients:  items with non-integral
implicit widths will sometimes lay out  exactly 1 pixel larger. This
won't be an actual problem for existing code. Implicit  sizes already
get rounded up about half the time and layouts should already  be
prepared for that.
FIXED-IN: 5.98

M  +1    -0    autotests/CMakeLists.txt
A  +50   -0    autotests/tst_formlayout.qml  *
M  +2    -2    src/controls/FormLayout.qml

The files marked with a * at the end have a non valid license. Please read:
https://community.kde.org/Policies/Licensing_Policy and use the headers which
are listed at that page.


https://invent.kde.org/frameworks/kirigami/commit/2676403e803d84e4963fa4e5f3779012e001bf24

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to