diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-08-16 17:32:51 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-10-17 20:38:16 +0200 |
commit | 7823c15c4dd68faa911d3807c8133f358854eb3e (patch) | |
tree | f3f937b5b5880b91f4597a00f43924cea9f8a8ec /dw/oofposabsmgr.hh | |
parent | a4301a9954d4835a4b87344b9b037a816b17286d (diff) |
Add support for aspect ratio in Widget
Images should preserve their own aspect ratio, which is determined by
the image buffer size, also known as the intrinsic size. Currently, when
a child requests a requisition to be corrected by correctRequisition(),
only the size was adjusted, ignoring the aspect ratio.
The new Widget ratio variable holds the desired aspect ratio for the
widget, and will only be taken into account when non-zero. In that case,
then correcting the requisition, a naive algorithm tries to first
increase the length of the small size to fill the preferred aspect
ratio. In the case that it is not enough, the larger size is then
decreased to fit the aspect ratio. And if that doesn't work either, the
aspect ratio is not enforced and the widget will be distorted.
There are special cases for correctRequisition() depending if the parent
exists or not. The same approach is taken for both cases, but using the
viewport size instead of the parent size.
Diffstat (limited to 'dw/oofposabsmgr.hh')
0 files changed, 0 insertions, 0 deletions