Kaydet (Commit) 14a56533 authored tarafından ekuiitr's avatar ekuiitr Kaydeden (comit) Miklos Vajna

SmartArt Pyramid: Now lays out shapes

This algorithm was initially not implemented, because of that it was
not able to show shapes which relates to pyramid, but with this patch,
It rendered correctly except some minor adjustement values issues which
can be fixed in upcoming patches.

Change-Id: I298c812615956d67eb00e1b7544d7b171a4ac14a
Reviewed-on: https://gerrit.libreoffice.org/57241
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst 350a9ddc
......@@ -531,7 +531,38 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
}
case XML_pyra:
{
if (rShape->getChildren().empty() || rShape->getSize().Width == 0 || rShape->getSize().Height == 0)
break;
// const sal_Int32 nDir = maMap.count(XML_linDir) ? maMap.find(XML_linDir)->second : XML_fromT;
// const sal_Int32 npyraAcctPos = maMap.count(XML_pyraAcctPos) ? maMap.find(XML_pyraAcctPos)->second : XML_bef;
// const sal_Int32 ntxDir = maMap.count(XML_txDir) ? maMap.find(XML_txDir)->second : XML_fromT;
// const sal_Int32 npyraLvlNode = maMap.count(XML_pyraLvlNode) ? maMap.find(XML_pyraLvlNode)->second : XML_level;
// uncomment when use in code.
sal_Int32 nCount = rShape->getChildren().size();
double fAspectRatio = 0.32;
awt::Size aChildSize = rShape->getSize();
aChildSize.Width /= nCount;
aChildSize.Height /= nCount;
awt::Point aCurrPos(0, 0);
aCurrPos.X = fAspectRatio*aChildSize.Width*(nCount-1);
aCurrPos.Y = fAspectRatio*aChildSize.Height;
for (auto & aCurrShape : rShape->getChildren())
{
aCurrShape->setPosition(aCurrPos);
aCurrPos.X -= aChildSize.Height/(nCount-1);
aChildSize.Width += aChildSize.Height;
aCurrShape->setSize(aChildSize);
aCurrShape->setChildSize(aChildSize);
aCurrPos.Y += (aChildSize.Height);
}
break;
}
case XML_snake:
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment