Esempio n. 1
0
 internal void UpdateCache(Shapes.DiagramShape obj, ChangedEventArgs evt)
 {
     foreach (GoLayerCache cache1 in this.Caches)
     {
         RectangleF ef1 = evt.OldRect;
         ef1 = obj.ExpandPaintBounds(ef1, cache1.View);
         RectangleF ef2 = evt.NewRect;
         ef2 = obj.ExpandPaintBounds(ef2, cache1.View);
         bool flag1 = Shapes.DiagramShape.IntersectsRect(cache1.Rect, ef1);
         bool flag2 = Shapes.DiagramShape.IntersectsRect(cache1.Rect, ef2);
         if ((!flag1 && flag2) && !cache1.Objects.Contains(obj))
         {
             cache1.Objects.Add(obj);
         }
     }
 }
Esempio n. 2
0
        internal void InsertIntoCache(Shapes.DiagramShape obj)
        {
            RectangleF ef1 = obj.Bounds;

            foreach (GoLayerCache cache1 in this.Caches)
            {
                RectangleF ef2 = obj.ExpandPaintBounds(ef1, cache1.View);
                if (Shapes.DiagramShape.IntersectsRect(cache1.Rect, ef2))
                {
                    cache1.Objects.Add(obj);
                }
            }
        }
Esempio n. 3
0
        internal void RemoveFromCache(Shapes.DiagramShape obj)
        {
            RectangleF ef1 = obj.Bounds;

            foreach (GoLayerCache cache1 in this.Caches)
            {
                RectangleF ef2 = obj.ExpandPaintBounds(ef1, cache1.View);
                if (Shapes.DiagramShape.IntersectsRect(cache1.Rect, ef2))
                {
                    Shapes.DiagramShapeCollection.fastRemove(cache1.Objects, obj);
                    Shapes.DiagramShapeCollection.fastRemove(cache1.Strokes, obj);
                }
            }
        }
Esempio n. 4
0
        public void Paint(Graphics g, DiagramView view, RectangleF clipRect)
        {
            bool flag1 = view.IsPrinting;

            if (!(flag1 ? !this.CanPrintObjects() : !this.CanViewObjects()))
            {
                RectangleF   ef1    = view.DocExtent;
                GoLayerCache cache1 = this.FindCache(view);
                if ((cache1 != null) && (cache1.Rect == ef1))
                {
                    foreach (Shapes.DiagramShape obj1 in cache1.Objects)
                    {
                        if (!(flag1 ? obj1.CanPrint() : obj1.CanView()))
                        {
                            continue;
                        }
                        RectangleF ef2 = obj1.Bounds;
                        ef2 = obj1.ExpandPaintBounds(ef2, view);
                        if (Shapes.DiagramShape.IntersectsRect(ef2, clipRect))
                        {
                            obj1.Paint(g, view);
                        }
                    }
                }
                else
                {
                    LayerEnumerator enumerator2;
                    if (this.CacheWanted(view))
                    {
                        if (cache1 == null)
                        {
                            cache1 = new GoLayerCache(view);
                            this.Caches.Add(cache1);
                        }
                        else
                        {
                            cache1.Reset();
                        }
                        cache1.Rect = ef1;
                        enumerator2 = this.GetEnumerator();
                        while (enumerator2.MoveNext())
                        {
                            Shapes.DiagramShape obj2 = enumerator2.Current;
                            RectangleF          ef3  = obj2.Bounds;
                            ef3 = obj2.ExpandPaintBounds(ef3, view);
                            if ((flag1 ? obj2.CanPrint() : obj2.CanView()) && Shapes.DiagramShape.IntersectsRect(ef3, clipRect))
                            {
                                obj2.Paint(g, view);
                            }
                            if (Shapes.DiagramShape.IntersectsRect(ef3, ef1))
                            {
                                cache1.Objects.Add(obj2);
                            }
                        }
                    }
                    else
                    {
                        enumerator2 = this.GetEnumerator();
                        while (enumerator2.MoveNext())
                        {
                            Shapes.DiagramShape obj3 = enumerator2.Current;
                            if (flag1 ? obj3.CanPrint() : obj3.CanView())
                            {
                                RectangleF ef4 = obj3.Bounds;
                                ef4 = obj3.ExpandPaintBounds(ef4, view);
                                if (Shapes.DiagramShape.IntersectsRect(ef4, clipRect))
                                {
                                    obj3.Paint(g, view);
                                }
                            }
                        }
                    }
                }
            }
        }