Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram Margin. (Read 1439 times)
andrei
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Jul 14th, 2010
Diagram Margin.
Jul 14th, 2010 at 12:04pm
Print Post  
In my project i have a diagram control, a ruler control and an overview window.

The diagram control is a custom diagram which inherits the Mindfusion.Diagram user control. In this custom control, I draw extra information, like the diagram name, author, and different information about the objects which contains. All these information are drawn using the OnRender method on regions which are outside the diagram bounds.

1) Rect (0, -100, actualWidth, 50)
2) Rect (-200, 0, 150, actualHeight)

The problem that I have, is that the ruler scroll starts from (0,0). I need it to display a region of 500 around the diagram bounds. If I set the Diagram.Margin to 500 the ruler displays the area correctly, but every time when the diagram receives focus and the diagram is not fully in the visible area but some of the margins are, the scroll jumps to (0,0) or (maxW, maxH), depending which one is closer.

Another problem is that the overview window doesn't take into consideration the margins. If the Diagram.Margin is set to 500 the overview will still take into consideration only the Diagram.Bounds size. (0,0) for the overview will be (0,0) for the ruler and (maxW, maxH) for the overview will be (Diagram.Bounds.Width, Diagram.Bounds.Height) for the ruler, and not
(Diagram.Bounds.Width + Diagram.Margin.Left + Diagram.Margin.Right,
Diagram.Bounds.Height + Diagram.Margin.Top + Diagram.Margin.Bottom)

Thanks,
Andrei
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram Margin.
Reply #1 - Jul 14th, 2010 at 12:17pm
Print Post  
It seems the diagram inherits this Margin property from its base classes, but our code never considers it. Instead, you might subtract the margins size from the top and left sides of diagram.Bounds, and handle NodeModifying to stop users from moving nodes to negative coordinates.

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