示例#1
0
        public bool HitTest(AxMap pMap, PointF pt)
        {
            float num = (float)(this.m_Zoom / pMap.Zoom);

            num = Conversions.ToSingle(Operators.MultiplyObject(num, Interaction.IIf(this.m_MWidth > 0f, pMap.MapScreenWidth / this.m_MWidth, 1)));
            float num2;
            float num3;

            pMap.ConvertCoord(ref num2, ref num3, ref this.m_GocX, ref this.m_GocY, ConversionConstants.miMapToScreen);
            Matrix matrix = new Matrix();

            matrix.Translate(-num2, -num3, MatrixOrder.Append);
            matrix.Scale(1f / num, 1f / num, MatrixOrder.Append);
            PointF[] array = new PointF[]
            {
                pt
            };
            matrix.TransformPoints(array);
            PointF pt2 = new PointF(array[0].X, array[0].Y);

            checked
            {
                bool result;
                if (this.m_GObjs.Count > 0)
                {
                    for (int i = this.m_GObjs.Count - 1; i >= 0; i += -1)
                    {
                        GraphicObject graphicObject = this.m_GObjs[i];
                        if (graphicObject.HitTest(pt2))
                        {
                            result = true;
                            return(result);
                        }
                    }
                }
                result = false;
                return(result);
            }
        }