コード例 #1
0
        /// <summary>
        /// 给定的坐标是否在结束活动条触发区域内
        /// </summary>
        /// <param name="pos"></param>
        /// <param name="startX"></param>
        /// <param name="width"></param>
        /// <returns></returns>
        public bool IsInEndZoom(Vector2 pos)
        {
            switch (m_Orient)
            {
            case Orient.Horizonal:
                var end = context.x + context.width * m_End / 100;
                return(ChartHelper.IsInRect(pos, end - 10, end + 10, context.y, context.y + context.height));

            case Orient.Vertical:
                end = context.y + context.height * m_End / 100;
                return(ChartHelper.IsInRect(pos, context.x, context.x + context.width, end - 10, end + 10));

            default:
                return(false);
            }
        }
コード例 #2
0
        /// <summary>
        /// 给定的坐标是否在开始活动条触发区域内
        /// </summary>
        /// <param name="pos"></param>
        /// <param name="startX"></param>
        /// <param name="width"></param>
        /// <returns></returns>
        public bool IsInStartZoom(Vector2 pos)
        {
            switch (m_Orient)
            {
            case Orient.Horizonal:
                var start = context.x + context.width * m_Start / 100;
                return(ChartHelper.IsInRect(pos, start - 10, start + 10, context.y, context.y + context.height));

            case Orient.Vertical:
                start = context.y + context.height * m_Start / 100;
                return(ChartHelper.IsInRect(pos, context.x, context.x + context.width, start - 10, start + 10));

            default:
                return(false);
            }
        }