Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic resizeToFitItems() after Lane node rotating 270degrees crops not corectly. (Read 3078 times)
tadeus
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Mar 17th, 2017
resizeToFitItems() after Lane node rotating 270degrees crops not corectly.
Mar 17th, 2017 at 11:24am
Print Post  
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.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: resizeToFitItems() after Lane node rotating 270degrees crops not corectly.
Reply #1 - Mar 17th, 2017 at 12:20pm
Print Post  
Hi,

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

Code
Select All
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;
} 



edit: first getBounds becomes getRotatedBounds too

Regards,
Slavcho
« Last Edit: Mar 17th, 2017 at 1:58pm by Slavcho »  
Back to top
 
IP Logged
 
tadeus
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Mar 17th, 2017
Re: resizeToFitItems() after Lane node rotating 270degrees crops not corectly.
Reply #2 - Mar 20th, 2017 at 11:20am
Print Post  
Thank You, it works.

Best Regards, Tadeus
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint