public static int OffsetY(CanvasElement canvas, ElementEvent e)
        {
            int y = 0;
            MouseCanvasElement element = (MouseCanvasElement)(object)canvas;
            MouseEvent         me      = (MouseEvent)(object)e;

            if (element.offsetParent != null)
            {
                do
                {
                    y += element.offsetTop;
                } while ((element = element.offsetParent) != null);
            }

            // Add padding and border style widths to offset
            //y += me.stylePaddingTop;

            //y += me.styleBorderTop;

            return(me.PageY - y);
        }
        public static int OffsetX(CanvasElement canvas, ElementEvent e)
        {
            int x = 0;
            MouseCanvasElement element = (MouseCanvasElement)(object)canvas;
            MouseEvent         me      = (MouseEvent)(object)e;

            if (element.offsetParent != null)
            {
                do
                {
                    x += element.offsetLeft;
                } while ((element = element.offsetParent) != null);
            }

            // Add padding and border style widths to offset
            //x += me.stylePaddingLeft;

            //x += me.styleBorderLeft;

            return(me.PageX - x);
        }