Skip to content

Y20251204-1000

@HeikoKlare HeikoKlare tagged this 04 Dec 13:43
The invertibility of point/pixel conversions is limited as point values
are int-based and with lower resolution than pixel values. In
consequence, values need to be rounded when converted between the two,
which inevitably leads to rounded values that do not fit for every use
case. This adds test cases that demonstrate such use cases, including
simple parent/child scenarios, in which the child is supposed to fill
the parent, and including layouting scenarios incorporating the client
area of a composite, and how the current implementation is not capable
of producing proper results for them.

This change also adapts the methods for setting bounds/size of controls
to deal with the limited invertibility. They shrink the calculated pixel
values by at most the maximum error that can be made when transforming
from point to pixel values, such that rounding errors due to layouts
that calculated control bounds based on a composites client area are
evened out. Without that, layouted controls may be up to one point too
large to fit into the composite.
Assets 2
Loading