Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Resizing of Diagram (Read 1370 times)
lutz
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 18
Joined: Aug 26th, 2009
Resizing of Diagram
Sep 14th, 2009 at 7:47am
Print Post  
Hi,

i am using a grid with several row headers, but only one column header.

How can i solve the problem, that after enlargement of the column header height the whole diagram is moved downwards but the size displayed isn't changing - bottom region is cut off?

I had set the parameter for enlargement in all directions, but that didn't help.

Thanks in advance
Lutz
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Resizing of Diagram
Reply #1 - Sep 14th, 2009 at 10:31am
Print Post  
The Diagram.AutoResize property does not take into consideration the lane grid when determining whether to enlarge the diagram. You have to manually modify the bounding rectangle in response to a change in the lane grid size. The following code illustrates how:

Code
Select All
Rect rowHeader = diagram1.LaneGrid.GetRowHeaderBounds();
Rect columnHeader = diagram1.LaneGrid.GetColumnHeaderBounds();
Rect union = Rect.Union(rowHeader, columnHeader);

Rect diagramBounds = diagram1.Bounds;
if (diagramBounds.Right < union.Right)
      diagramBounds.Width = union.Right - diagramBounds.Left;
if (diagramBounds.Bottom < union.Bottom)
      diagramBounds.Height = union.Bottom - diagramBounds.Top;

diagram1.Bounds = diagramBounds; 


The variable diagram1 references the Diagram instance.

Use the code above when the size of the column header changes.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint