Exemplo n.º 1
0
        private void _zoomStart(UIPinchGestureRecognizer recognizer)
        {
            if (embeddingView == null || previewLayer == null)
            {
                return;
            }

            var allTouchesOnPreviewLayer = true;
            var numTouch = recognizer.NumberOfTouches;

            for (int i = 0; i < numTouch; i++)
            {
                var location       = recognizer.LocationOfTouch(i, embeddingView);
                var convertedTouch = previewLayer.ConvertPointFromLayer(location, previewLayer.SuperLayer);
                if (!previewLayer.Contains(convertedTouch))
                {
                    allTouchesOnPreviewLayer = false;
                    break;
                }
            }
            if (allTouchesOnPreviewLayer)
            {
                _zoom(recognizer.Scale);
            }
        }