Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to use resizeToFitText in a web page? (Read 2444 times)
FireFoxFreak
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Sep 26th, 2008
How to use resizeToFitText in a web page?
Sep 26th, 2008 at 10:51am
Print Post  
Hi,

I have a problem using resizeToFitText in a web page's Javascript as I cannot figure out how to create an instance of FitSize:

function load()
{
var applet = document.getElementById("fcapplet");
fc = applet.getDiagram();
var node = fc.getFactory().createShapeNode(0, 0, 50, 50);
node.setText("Node #1")

//This does not work in JavaScript !!!!!!
node.resizeToFitText(FitSize.KeepHeight);
//!!!!!!!!!!!!!!!!!!!!!!!!!!!
}

Please help.
Best regards.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to use resizeToFitText in a web page?
Reply #1 - Sep 26th, 2008 at 10:59am
Print Post  
Hi,

That happens because inadvertently we've changed the FitSize type to enum, instead of declaring int constants as possible FitSize values. We'll return it back to int constants in next release. Until then you can use the following method to get the enum value:

node.resizeToFitText(applet.getScriptHelper().getConstant("FitSize", "KeepHeight"));

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
FireFoxFreak
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Sep 26th, 2008
Re: How to use resizeToFitText in a web page?
Reply #2 - Sep 27th, 2008 at 6:51pm
Print Post  
This works for me - thanks Stoyo!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint