We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem with rotate nodes

Thread ID:

Created:

Updated:

Platform:

Replies:

148067 Oct 3,2019 08:57 PM UTC Oct 7,2019 11:25 AM UTC WinForms 3
loading
Tags: Diagram
George
Asked On October 3, 2019 08:57 PM UTC

Hi ,
I am using a diagram and add richtextnodes
I allow the user to turn them (through the context menu)
I save the X,Y,Width,Height and rotation to a database and when the user opens a specific diagram it loads the nodes.
All the nodes that have been rotated have got a different position from the one that user saved

How I save the node 
 NodeX = Convert.ToInt32(rtxtNode.BoundingRectangle.Location.X);
 NodeY = Convert.ToInt32(rtxtNode.BoundingRectangle.Location.Y);
 NodeWidth = Convert.ToInt32(rtxtNode.Size.Width);
 NodeHeight = Convert.ToInt32(rtxtNode.Size.Height);
 NodeRotation = Convert.ToInt32(rtxtNode.RotationAngle); 

How i Load the node
this.diagram1.BeginUpdate();
            RichTextNode richTextNode = new RichTextNode("",
                                              new RectangleF(NodeX,
                                                             NodeY,
                                                             NodeWidth,
                                                             NodeHeight));


            richTextNode.RotationAngle = Properties.Settings.Default.Rotation;
            diagram1.Model.AppendChild(richTextNode);
this.diagram1.EndUpdate();

In the attached folder you can find a sample and a video how to reproduce the problem



Attachment: Projects_cf8bb82a.7z

Shyam G [Syncfusion]
Replied On October 4, 2019 10:24 AM UTC

Hi George, 
 
To resolve your issue, please use below code example to get the node bounds. 
 
Code example: 
private void btnSave_Click(object sender, EventArgs e) 
        { 
            foreach (Node node in diagram1.Model.Nodes) 
            { 
                if (node is RichTextNode) 
                { 
                    RichTextNode rtxtNode = (RichTextNode)node; 
                    RectangleF nodeBounds = new RectangleF(rtxtNode.PinPoint.X - rtxtNode.PinPointOffset.Width, rtxtNode.PinPoint.Y - rtxtNode.PinPointOffset.Height, rtxtNode.Size.Width, rtxtNode.Size.Height);                   
} } } 
 
 
We have modified the sample and provided below. 
 
 
Regards, 
Shyam G 


George
Replied On October 4, 2019 04:13 PM UTC

Thank you

Aravind Ravi [Syncfusion]
Replied On October 7, 2019 11:25 AM UTC

Hi George, 
 
Thanks for the update. Please let us know if you need any further assistance. 
 
Regards 
Aravind Ravi 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon