private void CheckPinch(float wheelAxis)
        {
            if (_listPinch == null)
            {
                return;
            }

            for (int i = 0, len = _listPinch.Count; i < len; ++i)
            {
                GesturePinch pinch = _listPinch[i];

                pinch._wheel += wheelAxis;

                if (pinch.pinchIn)
                {
                    if (pinch.threshold < pinch._wheel)
                    {
                        pinch._wheel = 0.0f;
                        pinch.callback();
                    }
                }
                else
                {
                    if (pinch.threshold < -pinch._wheel)
                    {
                        pinch._wheel = 0.0f;
                        pinch.callback();
                    }
                }
            }
        }
Beispiel #2
0
        public bool RemovePinch(GesturePinch pinch)
        {
            if (pinch == null || _listPinch == null)
            {
                return(false);
            }

            return(_listPinch.Remove(pinch));
        }
Beispiel #3
0
        public bool AddPinch(GesturePinch pinch)
        {
            if (pinch == null)
            {
                return(false);
            }

            if (_listPinch == null)
            {
                _listPinch = new List <GesturePinch>();
            }

            _listPinch.Add(pinch);

            return(true);
        }