LayoutFarm.Svg.SvgHitChain.SetRootGlobalPosition C# (CSharp) Method

SetRootGlobalPosition() public method

public SetRootGlobalPosition ( float x, float y ) : void
x float
y float
return void
        public void SetRootGlobalPosition(float x, float y)
        {
            this.rootGlobalX = x;
            this.rootGlobalY = y;
        }
    }

Usage Example

        void IEventPortal.PortalMouseDown(UIMouseEventArgs e)
        {
            //find hit svg graphics....
            SvgHitChain hitChain = GetFreeHitChain();

            hitChain.SetRootGlobalPosition(e.X, e.Y);
            //1. hit test
            HitTestCore(this.SvgRoot.SvgSpec, hitChain, e.X, e.Y);
            SetEventOrigin(e, hitChain);
            //2. propagate event  portal
            ForEachOnlyEventPortalBubbleUp(e, hitChain, (portal) =>
            {
                portal.PortalMouseDown(e);
                return(true);
            });
            if (!e.CancelBubbling)
            {
                //2. propagate events
                ForEachSvgElementBubbleUp(e, hitChain, () =>
                {
                    //-------
                    //temp test only
                    //-------
                    var svgElement = e.ExactHitObject as SvgElement;
                    if (svgElement is SvgRect)
                    {
                        ((SvgRect)svgElement).FillColor = Color.White;
                    }
                    return(true);
                });
            }

            e.CancelBubbling = true;
            ReleaseHitChain(hitChain);
        }
All Usage Examples Of LayoutFarm.Svg.SvgHitChain::SetRootGlobalPosition