The MindFusion Forums
Flow Diagramming Components >> ASP.NET >> resizeToFitItems() after Lane node rotating 270degrees crops not corectly.
https://mindfusion.eu/Forum/YaBB.pl?num=1489749843

Message started by tadeus on Mar 17th, 2017 at 11:24am

Title: resizeToFitItems() after Lane node rotating 270degrees crops not corectly.
Post by tadeus on Mar 17th, 2017 at 11:24am
Hello!
I heve created Lane node with RotationAngle = 270.

When I call resizeToFitItems() method it crops like Lane is not rotated:

How I can resolve this problem?
Thank You.

Title: Re: resizeToFitItems() after Lane node rotating 270degrees crops not corectly.
Post by Slavcho on Mar 17th, 2017 at 12:20pm
Hi,

It seems we disregard rotation when calculating new diagram bounds, try this as a fix for time being -

[code]
Diagram.prototype.getContentBounds = function ()
{
    var rect = Rect.empty;
    ArrayList.forEach(this.items, function (item)
    {
        if (rect == Rect.empty)
            rect = item.getRotatedBounds();
        else
            rect = rect.union(item.getRotatedBounds());
    });
    return rect;
}[/code]

edit: first getBounds becomes getRotatedBounds too

Regards,
Slavcho

Title: Re: resizeToFitItems() after Lane node rotating 270degrees crops not corectly.
Post by tadeus on Mar 20th, 2017 at 11:20am
Thank You, it works.

Best Regards, Tadeus

The MindFusion Forums » Powered by YaBB 2.6.11!
YaBB Forum Software © 2000-2024. All Rights Reserved.