Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ShapeNode.ResizeToFitText() does not seem to work for longer words (Read 3005 times)
Cyrinael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 22nd, 2016
ShapeNode.ResizeToFitText() does not seem to work for longer words
Aug 2nd, 2016 at 8:59am
Print Post  
Hi,

i currently have a problem with
Code
Select All
ShapeNode.ResizeToFitText(FitSize.KeepRatio); 

on a node with an arbitrary text. Often the node is not correctly resized, so that the full text is clipped and the return value for those nodes is also true, even though the resize is not done correctly.

I tested with different words length and node sizes and it seems, that the reiszing is not working properly for longer words. All nodes are standardized with a Size of 70x60, but also changing the size does not seem to matter. In the attachment you can see one node with 2 words that is not correctly resized. I also appended a example with a test node, that contains more letters than the original node.

Thank you,

Cyrinael
  

ResizeToFit.PNG ( 1 KB | 87 Downloads )
ResizeToFit.PNG
WithoutResizing.PNG ( 1 KB | 88 Downloads )
WithoutResizing.PNG
ShortWordsWithResizing.PNG ( 1 KB | 66 Downloads )
ShortWordsWithResizing.PNG
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: ShapeNode.ResizeToFitText() does not seem to work for longer words
Reply #1 - Aug 2nd, 2016 at 4:12pm
Print Post  
Hi,

What's the exact text assigned to the incorrectly-sized node?

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Cyrinael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 22nd, 2016
Re: ShapeNode.ResizeToFitText() does not seem to work for longer words
Reply #2 - Aug 3rd, 2016 at 5:56am
Print Post  
Hi Slavcho,

the text is "Sydney KEG3101501". It appears to be because of the length of the second word. I have serveral text nodes with the same pattern like "Sydney KEG3101502", etc. and they all behave the same.

The interesting thing is that, if I insert a second word inbetween like "Sydney xATM KEG3101501", the resizing works properly.

Thank you,

Cyrinael
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: ShapeNode.ResizeToFitText() does not seem to work for longer words
Reply #3 - Aug 3rd, 2016 at 8:54am
Print Post  
Hi Cyrinael,

It shows even smaller part of the text for me with everything at default values - our developer will debug it. To be sure we are comparing same things, could you also post any text-related properties that your application changes, like font and padding, or attach a saved diagram file?

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Cyrinael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 22nd, 2016
Re: ShapeNode.ResizeToFitText() does not seem to work for longer words
Reply #4 - Aug 3rd, 2016 at 9:19am
Print Post  
Hi Slavcho,

i created a new WPF Project with a plain Diagram. I did not set any styles or properties of the diagram.

Furthermore, I created the node with the following code:
Code
Select All
 ShapeNode node = new ShapeNode(diagram);
            node.Text = "Sydney KEG3101501";
            node.Bounds = new Rect(1, 1, 70, 60);
            node.ResizeToFitText(FitSize.KeepRatio);
            diagram.Nodes.Add(node); 



Nevertheless, the Node is not resized properly.

Best Regards,

Cyrinael
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: ShapeNode.ResizeToFitText() does not seem to work for longer words
Reply #5 - Aug 4th, 2016 at 6:48am
Print Post  
Hi,

This build should fix it -
https://mindfusion.eu/_beta/wpfdiag_keepratio.zip

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Cyrinael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 22nd, 2016
Re: ShapeNode.ResizeToFitText() does not seem to work for longer words
Reply #6 - Aug 4th, 2016 at 10:48am
Print Post  
Hi Slavcho,

the new build works very well!

Thank you very much,

Cyrinael
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint