oox smartart: snake algo: apply constraints on child shape widths
commit5d899bf3ee59a226f855c8c56389344862efaa95
authorMiklos Vajna <vmiklos@collabora.com>
Tue, 29 Sep 2020 15:41:12 +0000 (29 17:41 +0200)
committerMiklos Vajna <vmiklos@collabora.com>
Tue, 29 Sep 2020 19:05:54 +0000 (29 21:05 +0200)
treec08388d5bbea4f978d0839ccd7aa6d597ae4dfa6
parent24e69c8450004e9ae40f40d4bee76b50d0f017d9
oox smartart: snake algo: apply constraints on child shape widths

This requires tracking what is the total of the width request of child
shapes, then scaling them according to what is the total available
width.

Additionally, the height of child shapes should be adjusted based on
their aspect ratio requests. A related trap is when an (invisible)
spacing shape is at the end of the row, that would result in smaller
spacing between the rows, so track the max height of shapes inside a
single row.

With this, finally the 6 child shapes are arranged on 2 rows, not 3
ones.

Change-Id: I4eb2f06676df11c1432e0934ca3a0ec8891c5843
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103629
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
oox/source/drawingml/diagram/diagramlayoutatoms.cxx
sd/qa/unit/import-tests-smartart.cxx