/// <summary> /// Hit-tests a geometry against this content /// </summary> /// <param name="geometry"> PathGeometry to hit-test for. </param> /// <returns> /// IntersectionDetail describing the result of the hit-test /// </returns> public IntersectionDetail HitTestGeometry(PathGeometry geometry) { HitTestDrawingContextWalker ctx = new HitTestWithGeometryDrawingContextWalker(geometry); DrawingContextWalk(ctx); return(ctx.IntersectionDetail); }
/// <summary> /// Hit-tests a Drawing against a PathGeometry /// </summary> /// <param name="drawing"> The drawing to hit test against </param> /// <param name="geometry"> The geometry (in local coordinate space) to hit test. </param> /// <returns> /// IntersectionDetail that describes the hit result /// </returns> internal static IntersectionDetail HitTestGeometry(Drawing drawing, PathGeometry geometry) { if (drawing != null) { HitTestDrawingContextWalker ctx = new HitTestWithGeometryDrawingContextWalker(geometry); drawing.WalkCurrentValue(ctx); return ctx.IntersectionDetail; } else { return IntersectionDetail.Empty; } }
/// <summary> /// Hit-tests a Drawing against a PathGeometry /// </summary> /// <param name="drawing"> The drawing to hit test against </param> /// <param name="geometry"> The geometry (in local coordinate space) to hit test. </param> /// <returns> /// IntersectionDetail that describes the hit result /// </returns> internal static IntersectionDetail HitTestGeometry(Drawing drawing, PathGeometry geometry) { if (drawing != null) { HitTestDrawingContextWalker ctx = new HitTestWithGeometryDrawingContextWalker(geometry); drawing.WalkCurrentValue(ctx); return(ctx.IntersectionDetail); } else { return(IntersectionDetail.Empty); } }
/// <summary> /// Hit-tests a geometry against this content /// </summary> /// <param name="geometry"> PathGeometry to hit-test for. </param> /// <returns> /// IntersectionDetail describing the result of the hit-test /// </returns> public IntersectionDetail HitTestGeometry(PathGeometry geometry) { HitTestDrawingContextWalker ctx = new HitTestWithGeometryDrawingContextWalker(geometry); DrawingContextWalk(ctx); return ctx.IntersectionDetail; }