Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic What are the resizeToFitText constants? (Read 2027 times)
Al
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Sep 3rd, 2014
What are the resizeToFitText constants?
Sep 3rd, 2014 at 1:20pm
Print Post  
Hi, I have looked through the help but nothing explains how to use 'diagramNode.resizeToFitText'

I saw a post recommending using
Code (Javascript)
Select All
node.resizeToFitText(applet.getScriptHelper().getConstant("FitSize", "KeepHeight")); 


but that just crashes my diagram.

When I tried using 0,1,2 I don't get what I was expecting. Please help.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: What are the resizeToFitText constants?
Reply #1 - Sep 3rd, 2014 at 1:45pm
Print Post  
Hi,

ScriptHelper is available only in our Java applet. For JavaScript version use the constants from MindFusion.Diagramming.FitSize enum:

Code
Select All
/**
* Specifies how the ResizeToFitText method should resize a node.
* @enum
* @name FitSize
* @param [KeepWidth] The original node width should remain intact.
* @param [KeepHeight] The original node height should remain intact.
* @param [KeepRatio] Allow changing both the width and height of a node, but keep the original width/height ratio if possible.
*/
MindFusion.Diagramming.FitSize = {
	KeepWidth: 0,
	KeepHeight: 1,
	KeepRatio: 2
}; 



If you need to fit the text tightly, start with a large node size and call resizeToFit twice - once keeping width and once keeping height.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Al
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Sep 3rd, 2014
Re: What are the resizeToFitText constants?
Reply #2 - Sep 3rd, 2014 at 1:52pm
Print Post  
Thank you - I had assumed the enum would run in that order, I'll try your suggestion.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint