Stoyo,
At the end of this message is the information you asked for.
I've also attached a set of images from my application (
http://www.flickr.com/photos/78608814@N00/) that show the weird docextents/zoomtorect behaviour, using the latest dll's from you. The scaling is performed using the following code, which I believe to be correct:
public void ZoomToVisible()
{
float minX = Single.MaxValue, minY = Single.MaxValue;
float maxX = -Single.MaxValue, maxY = -Single.MaxValue;
bool foundVisibleObject = false;
foreach (Box box in flowChart.Boxes)
{
if (box.Visible)
{
foundVisibleObject = true;
if (box.BoundingRect.Left < minX)
minX = box.BoundingRect.Left;
if (box.BoundingRect.Top < minY)
minY = box.BoundingRect.Top;
if (box.BoundingRect.Right > maxX)
maxX = box.BoundingRect.Right;
if (box.BoundingRect.Bottom > maxY)
maxY = box.BoundingRect.Bottom;
}
}
foreach (Arrow arrow in flowChart.Arrows)
{
if (arrow.Visible)
{
foundVisibleObject = true;
if (arrow.BoundingRect.Left < minX)
minX = arrow.BoundingRect.Left;
if (arrow.BoundingRect.Top < minY)
minY = arrow.BoundingRect.Top;
if (arrow.BoundingRect.Right > maxX)
maxX = arrow.BoundingRect.Right;
if (arrow.BoundingRect.Bottom > maxY)
maxY = arrow.BoundingRect.Bottom;
}
}
float width = maxX - minX;
float height = maxY - minY;
if (foundVisibleObject)
{
flowChart.DocExtents = new RectangleF(minX - width * 0.05F, minY - height * 0.05F, width * 1.1F, height * 1.1F);
flowChart.ZoomToRect(new RectangleF(minX - width * 0.05F, minY - height * 0.05F, width * 1.1F, height * 1.1F));
}
}
Which basically zooms to visible items +5% border. I am setting docextents at the moment here only as a test to work out what's going on...
In _a through _d you can see the slightly weird but not major problem of too thin but too high in the zoomtorect (the docextents seems to always work as expected, as does the actualy visible chart.)
_e and _f however really show the problem, in _e the visible-area marker in the overview window is missing completely! In _f I have clicked on the overview panel, and a visible-area marker appears (but without the black boundary) but it has nothing at all to do with what is visible...
-
flowChart.DocExtents
{X = 208.063919 Y = -232.671387 Width = 3968.19653 Height = 871.274841}
System.Drawing.RectangleF
Bottom
638.603455
float
Height
871.274841
float
IsEmpty
false
bool
Left
208.063919
float
+
Location
{X = 208.063919 Y = -232.671387}
System.Drawing.PointF
Right
4176.26025
float
+
Size
{Width = 3968.19653 Height = 871.274841}
System.Drawing.SizeF
Top
-232.671387
float
Width
3968.19653
float
X
208.063919
float
Y
-232.671387
float
+
Static members
+
Non-Public members
-
doc.DefaultPageSettings.Bounds
{X = 0 Y = 0 Width = 827 Height = 1169}
System.Drawing.Rectangle
Bottom
1169
int
Height
1169
int
IsEmpty
false
bool
Left
0
int
+
Location
{X = 0 Y = 0}
System.Drawing.Point
Right
827
int
+
Size
{Width = 827 Height = 1169}
System.Drawing.Size
Top
0
int
Width
827
int
X
0
int
Y
0
int
+
Static members
+
Non-Public members