Beispiel #1
0
 public bool TryAdd(ICharMetric cdi)
 {
     if (_rect.Y == cdi.CharRect.Y &&
         cdi.IndexEachLine == _indexOnLine + 1)
     {
         _rect        = _rect.Union(cdi.CharRect);
         _indexOnLine = cdi.IndexEachLine;
         return(true);
     }
     return(false);
 }
        private static Rect2D CalculateRect(Rect2D sourceRect, Rect2D targetRect, Route routePoints)
        {
            var rectUnion = sourceRect.Union(targetRect);

            if (routePoints != null)
            {
                foreach (var routePoint in routePoints)
                {
                    rectUnion = rectUnion.Union(routePoint);
                }
            }
            return(rectUnion);
        }
Beispiel #3
0
        public static Rect2D Boundary(this IPolyLine2D source)
        {
            Point start = source.StartPoint;
            var   ret   = new Rect2D(start, new Size());

            foreach (var s in source.Segments)
            {
                var sg = s.Convert(ref start);
                ret.Union(sg.GetBoundary(start));
                start = s.EndPoint;
            }
            return(ret);
        }