oox smartart: snake algo: apply constraints on child shape widths
commit2f00ae052c7f76329f341c8e5d56da3c940885a6
authorMiklos Vajna <vmiklos@collabora.com>
Tue, 29 Sep 2020 15:41:12 +0000 (29 17:41 +0200)
committerMiklos Vajna <vmiklos@collabora.com>
Wed, 30 Sep 2020 15:25:45 +0000 (30 17:25 +0200)
tree5138a6f5c75dd4a7c651469489043e261abe63d7
parentb41e6bd13f419fed23a0a5743c2f11b9bf91c40d
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.

(cherry picked from commit 5d899bf3ee59a226f855c8c56389344862efaa95)

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