Example #1
0
        public override int HitTest(PointF point, long currentTimestamp, DistortionHelper distorter, IImageToViewportTransformer transformer, bool zooming)
        {
            // Convention: miss = -1, object = 0, handle = n.
            // We do not need a special case to hit the radius or diameter line as they are inside the circle and
            // don't have special handling compared to just moving the whole thing.
            double opacity = infosFading.GetOpacityFactor(currentTimestamp);

            if (opacity <= 0)
            {
                return(-1);
            }

            if (trackExtraData != TrackExtraData.None && miniLabel.HitTest(point, transformer))
            {
                return(2);
            }

            if (IsPointOnHandler(point, transformer))
            {
                return(1);
            }

            if (IsPointInObject(point, transformer))
            {
                return(0);
            }

            return(-1);
        }
Example #2
0
        public override int HitTest(PointF point, long currentTimestamp, DistortionHelper distorter, IImageToViewportTransformer transformer, bool zooming)
        {
            int    result  = -1;
            double opacity = infosFading.GetOpacityFactor(currentTimestamp);

            if (tracking || opacity > 0)
            {
                if (trackExtraData != TrackExtraData.None && miniLabel.HitTest(point, transformer))
                {
                    result = 3;
                }
                else if (HitTester.HitTest(points["a"], point, transformer))
                {
                    result = 1;
                }
                else if (HitTester.HitTest(points["b"], point, transformer))
                {
                    result = 2;
                }
                else if (IsPointInObject(point, distorter, transformer))
                {
                    result = 0;
                }
            }

            return(result);
        }
        public override int HitTest(PointF point, long currentTimestamp, DistortionHelper distorter, IImageToViewportTransformer transformer, bool zooming)
        {
            // Convention: miss = -1, object = 0, handle = n.
            int    result  = -1;
            double opacity = infosFading.GetOpacityTrackable(trackingTimestamps, currentTimestamp);

            if (opacity > 0)
            {
                if (trackExtraData != TrackExtraData.None && miniLabel.HitTest(point, transformer))
                {
                    result = 1;
                }
                else if (HitTester.HitTest(points["0"], point, transformer))
                {
                    result = 0;
                }
            }

            return(result);
        }