Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Inconsistent Sizing (Read 1654 times)
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Inconsistent Sizing
May 7th, 2010 at 6:44pm
Print Post  
When I first load shapes from a database, I use the following code to optimize the shape size.

Node.ResizeToFitText(FitSize.KeepRatio)

And if it is edited, the following code re-optimizes the shape size.

var newFSize = applet().getScriptHelper().getConstant('FitSize', 'KeepRatio');
node.resizeToFitText(newFSize);

However, the first one has nice spacing around the text and second one doesn't, is there anyway to have consistent spacing around the two?

Thank you,
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Inconsistent Sizing
Reply #1 - May 7th, 2010 at 7:08pm
Print Post  
The resizeToFitText Java code is pretty much the same as the .NET's one, but perhaps the .NET text measuring methods report a slightly larger text layout rectangle. You could add a few pixels to the node's width and height after calling the applet's fitText method to make the node a bit larger.

Stoyan
  
Back to top
 
IP Logged
 
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Re: Inconsistent Sizing
Reply #2 - May 8th, 2010 at 12:39am
Print Post  
Thank you. I will try that approach.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint