예제 #1
0
        public System.Drawing.PointF AbsUnTransformPoint(float x, float y)
        {
            SimpleRectangleTransform pre  = null;
            SimpleRectangleTransform next = null;
            SimpleRectangleTransform cur  = null;

            foreach (SimpleRectangleTransform item in this)
            {
                if (item.Enable == false)
                {
                    continue;
                }
                if (intLimitedPageIndex >= 0 && item.PageIndex != intLimitedPageIndex)
                {
                    continue;
                }
                if (item.DescRectF.Contains(x, y))
                {
                    return(item.UnTransformPointF(x, y));
                }

                if (y >= item.DescRectF.Top && y < item.DescRectF.Bottom)
                {
                    cur = item;
                    break;
                }
                if (y < item.DescRectF.Top)
                {
                    if (next == null || item.DescRectF.Top < next.DescRectF.Top)
                    {
                        next = item;
                    }
                }
                if (y > item.DescRectF.Bottom)
                {
                    if (pre == null || item.DescRectF.Bottom > pre.DescRectF.Bottom)
                    {
                        pre = item;
                    }
                }
            }//foreach
            if (cur == null)
            {
                if (pre != null)
                {
                    cur = pre;
                }
                else
                {
                    cur = next;
                }
            }
            if (cur == null)
            {
                return(System.Drawing.PointF.Empty);
            }
            System.Drawing.PointF p = new System.Drawing.PointF(x, y);
            p = RectangleCommon.MoveInto(p, cur.DescRectF);
            return(cur.UnTransformPointF(p));
        }
예제 #2
0
 private System.Drawing.Point GetMousePosition(System.Drawing.Point p)
 {
     if (myBindControl != null)
     {
         p = myBindControl.PointToClient(p);
     }
     return(RectangleCommon.MoveInto(p, this.myClipRectangle));
 }