|
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
|