示例#1
0
        public override IHitTestObject HitTest(HitTestPointData htd)
        {
            HitTestObjectBase result = null;
            GraphicsPath      gp     = GetPath();

            if (_fillBrush.IsVisible && gp.IsVisible((PointF)htd.GetHittedPointInWorldCoord(_transformation)))
            {
                result = new ClosedCardinalSplineHitTestObject(this);
            }
            else if (_linePen.IsVisible && gp.IsOutlineVisible((PointF)htd.GetHittedPointInWorldCoord(_transformation), _linePen))
            {
                result = new ClosedCardinalSplineHitTestObject(this);
            }
            else
            {
                gp.Transform(htd.GetTransformation(_transformation)); // Transform to page coord
                if (gp.IsOutlineVisible((PointF)htd.HittedPointInPageCoord, new Pen(Color.Black, 6)))
                {
                    result = new ClosedCardinalSplineHitTestObject(this);
                }
            }

            if (result != null)
            {
                result.DoubleClick = EhHitDoubleClick;
            }

            return(result);
        }
示例#2
0
		public override IHitTestObject HitTest(HitTestPointData htd)
		{
			HitTestObjectBase result = null;
			GraphicsPath gp = GetPath();

			if (this._fillBrush.IsVisible && gp.IsVisible((PointF)htd.GetHittedPointInWorldCoord(_transformation)))
			{
				result = new ClosedCardinalSplineHitTestObject(this);
			}
			else if (this._linePen.IsVisible && gp.IsOutlineVisible((PointF)htd.GetHittedPointInWorldCoord(_transformation), _linePen))
			{
				result = new ClosedCardinalSplineHitTestObject(this);
			}
			else
			{
				gp.Transform(htd.GetTransformation(_transformation)); // Transform to page coord
				if (gp.IsOutlineVisible((PointF)htd.HittedPointInPageCoord, new Pen(Color.Black, 6)))
				{
					result = new ClosedCardinalSplineHitTestObject(this);
				}
			}

			if (result != null)
				result.DoubleClick = EhHitDoubleClick;

			return result;
		}