void UpdateGraphBoundingBoxWithCheck(GeometryObject geomObj)
        {
            var       cl   = geomObj as Cluster;
            Rectangle bBox = cl != null ? cl.BoundaryCurve.BoundingBox : geomObj.BoundingBox;
            {
                var edge = geomObj as GeomEdge;
                if (edge != null && edge.Label != null)
                {
                    bBox.Add(edge.Label.BoundingBox);
                }
            }
            var p = new Point(-Graph.Margins, Graph.Margins);

            Rectangle bounds = Graph.BoundingBox;

            GraphBoundingBoxGetsExtended |= bounds.AddWithCheck(bBox.LeftTop + p);
            GraphBoundingBoxGetsExtended |= bounds.AddWithCheck(bBox.RightBottom - p);
            Graph.BoundingBox             = bounds;
        }
예제 #2
0
        void UpdateGraphBoundingBoxWithCheck(GeometryObject geomObj)
        {
            var       cl   = geomObj as Cluster;
            Rectangle bBox = cl != null ? cl.BoundaryCurve.BoundingBox : geomObj.BoundingBox;
            {
                var edge = geomObj as GeomEdge;
                if (edge != null && edge.Label != null)
                {
                    bBox.Add(edge.Label.BoundingBox);
                }
            }
            var p = new Point(-Graph.Margins, Graph.Margins);

#if SHARPKIT //https://code.google.com/p/sharpkit/issues/detail?id=369 there are no structs in js
            Rectangle bounds = Graph.BoundingBox.Clone();
#else
            Rectangle bounds = Graph.BoundingBox;
#endif
            GraphBoundingBoxGetsExtended |= bounds.AddWithCheck(bBox.LeftTop + p);
            GraphBoundingBoxGetsExtended |= bounds.AddWithCheck(bBox.RightBottom - p);
            Graph.BoundingBox             = bounds;
        }