Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic is there a way to resize the canvas (Read 3404 times)
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
is there a way to resize the canvas
Jan 16th, 2013 at 5:13pm
Print Post  
Is there a way to resize the canvas?
Changing the width and height of the diagram doesn't work well. Can I change the diagramBounds?

When doing mouseover some part of the diagram, the content is redrawn, but the expanded part of the diagram has no backbrush and moving a node over it leaves a trail of nodes
  
Back to top
 
IP Logged
 
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
Re: is there a way to resize the canvas
Reply #1 - Jan 16th, 2013 at 11:10pm
Print Post  
I found that setBounds() is a method for diagram.
It isn't mentioned in Mindfusion.Diagramming for JavaScript programmer's Guide.
I found the solution on this forum in topic:
$get("canvas") function does not work well?
Thanks to Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: is there a way to resize the canvas
Reply #2 - Jan 17th, 2013 at 6:39am
Print Post  
It seems setBounds is declared in the Canvas class, a base class of Diagram, and our help generation system hasn't imported it. We'll try to fix this for next release. There are several other methods declared in Canvas that might be useful: setMeasureUnit, setZoomFactor, clientToDoc, docToClient, repaint.

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


I Love MindFusion!

Posts: 1
Joined: Feb 5th, 2013
Re: is there a way to resize the canvas
Reply #3 - Feb 5th, 2013 at 5:58am
Print Post  
Could you paste same code example, please?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: is there a way to resize the canvas
Reply #4 - Feb 5th, 2013 at 9:20am
Print Post  
Code
Select All
var Rect = MindFusion.Drawing.Rect;
var A4 = new Rect(0, 0, 210, 297);
diagram.setBounds(A4);

var xPixels = 800;
var yPixels = 800;
var mmSize = diagram.clientToDoc({ x: xPixels, y: yPixels });
diagram.setBounds(new Rect(0, 0, mmSize.x, mmSize.y)); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint