diff options
author | ekuiitr <jhaekansh80@gmail.com> | 2018-05-27 01:49:09 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-06-08 18:17:52 +0200 |
commit | f1368d6a45456b5682d588371cfa2efa5571d798 (patch) | |
tree | 68ae7818736dd4e54ec184ff0d57d982f0169f4a /oox/source/drawingml | |
parent | 32f1c56d8ff5e6f87dbcf086fd3743d6d36182bc (diff) |
Smartart: Corrected Line Algorithm
Earlier it display odd height of the children nodes as compared to
their width.
Change-Id: I379fb192afc5078d089ef276f35ca5a95ff60cfb
Reviewed-on: https://gerrit.libreoffice.org/54866
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'oox/source/drawingml')
-rw-r--r-- | oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index 92b6e9129591..366759581bc0 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -361,12 +361,22 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, if (nIncY) aChildSize.Height /= (nCount + (nCount-1)*fSpace); + if(nCount <= 2 && nIncY) + aChildSize.Height /= 2; + else + aChildSize.Height /= (nCount+1); + awt::Point aCurrPos(0, 0); if (nIncX == -1) aCurrPos.X = rShape->getSize().Width - aChildSize.Width; if (nIncY == -1) aCurrPos.Y = rShape->getSize().Height - aChildSize.Height; + if(nCount <= 2 && nIncY == -1) + aCurrPos.Y = rShape->getSize().Height - aChildSize.Height*2; + else + aCurrPos.Y = rShape->getSize().Height - aChildSize.Height*(nCount+1); + for (auto & aCurrShape : rShape->getChildren()) { aCurrShape->setPosition(aCurrPos); |