One issue affected the situation where the provided bounds wouldn't
start at (0, 0). Such bounds are regularly acquired by calling
Rectangle::reduced().
The other issue affected the width calculation of fractional items.
The error wasn't correctly integrated during the computation, and as a
consequence the last fractional element would exhibit all the
accumulated error.
Prior to this commit all Grid calculations were carried out using
floating point numbers. The dimensions of all items would then be
rounded with the same function to calculate the integer dimensions used
for Component layout. This resulted in layout solutions where the width
or height of items with dimensions specified using the absolute Px
quantity could differ from the correctly rounded value of these values.
This commit ensures that the width and height of these items are always
correct and their cumulative error in size is distributed among items
with fractional dimensions.
Until this commit Items with a size of 1 could be rounded to
bounds with a size of 0 or 2 due to floating point errors, leading
to slightly too large or disappearing items. The new approach
preserves the size of items.
Previously, positioning such an item would hang while trying to find an
appropriate position for the item, because no position in the grid was
suitable, and implicit cells in the layout direction would be added
until a viable position was found.
We now ensure that there are enough cells in the cross direction to hold
each of the auto-placement items before trying to position those items.
Negative indices should count backwards from the last explicit
row/column number. If the resulting line number would appear before
the first explicit row/column, implicit grid lines should be added
before the first explicit row/column.