Intersects() public méthode

public Intersects ( Region, otherRegion ) : bool
otherRegion Region,
Résultat bool
Exemple #1
0
        public sealed override void DrawBase(IDraw renderArgument, Region dirty)
        {
            bool offset = false;

            // trimSize is the size sans scrollbars.  but maybe we should just let the thing overdraw...
            Draw(renderArgument, dirty);
            renderArgument.uDraw.PushAxisAlignedClip(DisplayRectangle, false);

            //Old method...not use, better to keep child logic in Container Superclass.
            foreach (IComponent c in components)
            {
                if (!c.visible)
                {
                    continue;
                }
                if (c.Scrollable)
                {
                    var cdr = c.DisplayRectangle;
                    var fdr = new Rectangle(cdr.left - xOffset, cdr.top - yOffset, cdr.width, cdr.height);
                    if (!dirty.Intersects(fdr))
                    {
                        continue;
                    }
                    if (!offset)
                    {
                        renderArgument.uDraw.SetRenderOffset(new Point(-xOffset, -yOffset));
                        offset = true;
                    }
                    c.DrawBase(renderArgument, dirty);
                }
                else
                {
                    if (!dirty.Intersects(c.DisplayRectangle))
                    {
                        continue;
                    }
                    if (offset)
                    {
                        renderArgument.uDraw.SetRenderOffset(new Point(0, 0));
                        offset = false;
                    }
                    c.DrawBase(renderArgument, dirty);
                }
            }

            renderArgument.uDraw.PopAxisAlignedClip();
            if (offset)
            {
                renderArgument.uDraw.SetRenderOffset(new Point(0, 0));
            }

            // Corner square hax
            float hgap = HorizontalScrollbarVisible ? HorizontalScrollbarHeight : 0;
            float vgap = VerticalScrollbarVisible ? VerticalScrollbarWidth : 0;

            renderArgument.uDraw.FillRectangle(new Rectangle(Location.X + Size.width - vgap, Location.Y + Size.height - hgap, vgap, hgap), background);
        }
Exemple #2
0
 // NOTE: No need to VisibilityChain in these events, because they terminate from the base.
 public override void DrawBase(IDraw renderArgument, Region dirty)
 {
     Draw(renderArgument, dirty);
     foreach (IComponent c in components)
     {
         if (c.visible && dirty.Intersects(c.DisplayRectangle))
         {
             c.DrawBase(renderArgument, dirty);
         }
     }
 }
Exemple #3
0
        public void DrawBase(IDraw rt, Region dirty)
        {
            rt.uDraw.PushAxisAlignedClip(DisplayRectangle, false);
            Draw(rt, dirty);

            // Now we need to draw our childrens....
            foreach (IComponent c in components)
            {
                if (c.visible && dirty.Intersects(c.DisplayRectangle))
                {
                    c.DrawBase(rt, dirty);
                }
            }
            rt.uDraw.PopAxisAlignedClip();
        }