Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Zoom on one axis (Read 1620 times)
dossantos
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Mar 25th, 2013
Zoom on one axis
Sep 19th, 2013 at 9:10am
Print Post  
Hi all,

is it possible to zoom a diagramview only on one axis (X-zoom or Y-zoom), or otherwise directly manipulate the affine transform of the diagramview?

Cheers,
   Tim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zoom on one axis
Reply #1 - Sep 19th, 2013 at 9:59am
Print Post  
Hi,

You could override the Diagram.Draw method to apply additional scale; hit-testing won't work correctly then, but that still might be useful if you show read-only diagrams.

Alternatively, you could resize the diagram items:

Code
Select All
foreach (var node in diagram.Nodes)
{
	var r = node.Bounds;
	r.Y *= yScale;
	r.Height *= yScale;
	node.Bounds = r;
}

foreach (var link in diagram.Links)
{
	for (int i = 1; i < link.ControlPoints.Count - 1; i++)
	{
		var p = link.ControlPoints[i];
		p.Y *= yScale;
		link.ControlPoints[i] = p;
	}
} 



This will probably look better than using transforms, since it won't deform rounded corners, selection handles, fonts, etc.

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