internal override IInputElement InputHitTest(PTS.FSPOINT pt)
        {
            IInputElement ie = null;

            // Query paragraph details
            PTS.FSSUBTRACKDETAILS subtrackDetails;
            PTS.Validate(PTS.FsQuerySubtrackDetails(PtsContext.Context, _paraHandle.Value, out subtrackDetails));

            // Hittest subtrack content.

            // There might be possibility to get empty sub-track, skip the sub-track
            // in such case.
            if (subtrackDetails.cParas != 0)
            {
                // Get list of paragraphs
                PTS.FSPARADESCRIPTION [] arrayParaDesc;
                PtsHelper.ParaListFromSubtrack(PtsContext, _paraHandle.Value, ref subtrackDetails, out arrayParaDesc);

                // Render list of paragraphs
                ie = PtsHelper.InputHitTestParaList(PtsContext, pt, ref subtrackDetails.fsrc, arrayParaDesc);
            }

            // If nothing is hit, return the owner of the paragraph.
            if (ie == null && _rect.Contains(pt))
            {
                ie = Paragraph.Element as IInputElement;
            }

            return(ie);
        }
Example #2
0
        internal static IInputElement InputHitTestTrack(PtsContext ptsContext, PTS.FSPOINT pt, ref PTS.FSTRACKDESCRIPTION trackDesc)
        {
            if (trackDesc.pfstrack == IntPtr.Zero)
            {
                return(null);
            }
            IInputElement result = null;

            PTS.FSTRACKDETAILS fstrackdetails;
            PTS.Validate(PTS.FsQueryTrackDetails(ptsContext.Context, trackDesc.pfstrack, out fstrackdetails));
            if (fstrackdetails.cParas != 0)
            {
                PTS.FSPARADESCRIPTION[] arrayParaDesc;
                PtsHelper.ParaListFromTrack(ptsContext, trackDesc.pfstrack, ref fstrackdetails, out arrayParaDesc);
                result = PtsHelper.InputHitTestParaList(ptsContext, pt, ref trackDesc.fsrc, arrayParaDesc);
            }
            return(result);
        }
Example #3
0
        internal override IInputElement InputHitTest(PTS.FSPOINT pt)
        {
            IInputElement inputElement = null;

            PTS.FSSUBTRACKDETAILS fssubtrackdetails;
            PTS.Validate(PTS.FsQuerySubtrackDetails(base.PtsContext.Context, this._paraHandle.Value, out fssubtrackdetails));
            if (fssubtrackdetails.cParas != 0)
            {
                PTS.FSPARADESCRIPTION[] arrayParaDesc;
                PtsHelper.ParaListFromSubtrack(base.PtsContext, this._paraHandle.Value, ref fssubtrackdetails, out arrayParaDesc);
                inputElement = PtsHelper.InputHitTestParaList(base.PtsContext, pt, ref fssubtrackdetails.fsrc, arrayParaDesc);
            }
            if (inputElement == null && this._rect.Contains(pt))
            {
                inputElement = (base.Paragraph.Element as IInputElement);
            }
            return(inputElement);
        }